Use of Semicolons in Shell Script

Use of Semicolons in Shell Script

  • Instead of being on separate lines, statements can be separated by a semicolon (;)

– For example:

if grep “UNIX” myfile; then echo “Got it”; fi

– This actually works anywhere in the shell.

% cwd=`pwd`; cd $HOME; ls; cd $cwd

shell programming use of semicolon
shell programming use of semicolon

 

For any query or issue, feel free to discuss on http://discuss.eduguru.in