Paramaters

From KlavoWiki
Revision as of 00:18, 23 March 2009 by David (talk | contribs) (moved BASH Paramaters to Paramaters)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

If you require to check for any paramaters when the BASH script is executed, you can check for $1, $2 .... etc.

if [ $1 = "whatever" ]
then
  .
  .
  .
  .
fi

If no paramatres are specified

if [ -z $1 ];
then
  .
  .
  .
  .
fi