Date created: 08/02/18 09:02:02. Last modified: 03/10/21 09:32:49

Bash Notes

Bash style guides:

https://google.github.io/styleguide/shell.xml

https://github.com/anordal/shellharden/blob/master/how_to_do_things_safely_in_bash.md

https://www.davidpashley.com/articles/writing-robust-shell-scripts/

https://github.com/dylanaraps/pure-bash-bible

 

Escaping Strings:

$ # This string 'has single' "and double" quotes and a $
$ !:q:p
'# This string '\''has single'\'' "and double" quotes and a $'

$ printf '%q' 'This string has do"uble quotes"'
This\ strin\"g\ has\ double\ quotes\"

 

Syntax Checking:

https://www.shellcheck.net/

bash -n myscript.sh

Previous page: Syscalls On Linux
Next page: Backup Github