User Tools

Site Tools


info:bash

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
info:bash [2010-02-12 16:47]
sam $@ and $*
info:bash [2016-01-21 21:12] (current)
sam
Line 36: Line 36:
 ===== $* vs. $@ ===== ===== $* vs. $@ =====
 Both refer to all parameters, but ''​$@'',​ when double-quoted (i.e. ''<​nowiki>"​$@"</​nowiki>''​),​ makes the parameters individually quoted (''<​nowiki>"​$1"​ "​$2"​ ...</​nowiki>''​). For details, see the Bash Reference Manual, [[http://​www.gnu.org/​software/​bash/​manual/​bashref.html#​Special-Parameters|Special Parameters section]]. Both refer to all parameters, but ''​$@'',​ when double-quoted (i.e. ''<​nowiki>"​$@"</​nowiki>''​),​ makes the parameters individually quoted (''<​nowiki>"​$1"​ "​$2"​ ...</​nowiki>''​). For details, see the Bash Reference Manual, [[http://​www.gnu.org/​software/​bash/​manual/​bashref.html#​Special-Parameters|Special Parameters section]].
 +
 +===== Exit on Errors ("​Strict"​) =====
 +References: http://​redsymbol.net/​articles/​unofficial-bash-strict-mode/,​ https://​sipb.mit.edu/​doc/​safe-shell/​
 +
 +<code bash>
 +set -euo pipefail
 +</​code>​
 +
 +Or possibly also with IFS:
 +<​code>​
 +set -euo pipefail
 +IFS=$'​\n\t'​
 +</​code>​
 +
info/bash.txt · Last modified: 2016-01-21 21:12 by sam