ngs-docs/angus

Notes for the Intro to automation lesson

Opened this issue · 0 comments

fpsom commented

Notes to be included in the lesson

-Use set -x: stops the execution of a script if a command or pipeline has an error - which is the opposite of the default shell behaviour, which is to ignore errors in scripts

-Use set -e: prints out each command before executing it - extra useful for debug

Both options are great to include in the beginning of the file

  • Include #! /bin/bash in the beginning of the script to define the script interpreter

  • Include bash <scriptfile> as a means of running the script file (instead of going directly to ./<scriptfile>)

  • Include information on batch scripts

  • Check for flag in curl for not re-downloading the file every single time

  • Add the way to rename a screen; at creation screen -S <name>, after creation Ctrl+a, :sessionname <name>

  • Add commands to detach a screen without the shortcut: screen -d <ID>

  • Another way to terminate a screen without needing to reattach: screen -X -S [session # you want to kill] quit