FANDOM


basenameEdit

basename /tmp/local.hhh .hhh # -> local

CommentEdit

  • use "#" on beginning of line for single line comment
  • Multi line comment
  • example

<<COMMENT1
  a
  b
  c
COMMENT1

IfEdit

  • tutorial
  • Don't forget the whitespace between expression and semicolon.
  • Or, And
    • use "-a" or "-o" option in test

if exp ; then
  # do something
else exp2 ; then
  # do something
elif
  # do something
fi

Expression result
[ -d $dir ] true if the $dir exists and is directory
[ -f $file ] true if the $file exists. false if $file directory

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.