User Tools

Site Tools


cs471:cs_471_-_review_of_scripting_and_the_shell

Conditional command chaining is often used in scripts. Are the following code blocks equivalent?

Code block 1:

if [ ! -d /tmp/winders-in-use ]; then
   /home/vmwin1/bin/vmwinoff            # vmwinoff is a shell script
fi

Code block 2:

[ ! -d /tmp/winders-in-use ] || /home/vmwin1/bin/vmwinoff

<poll Are the above code blocks equivalent? (1)>

  • Yes
  • No

</poll>


cs471/cs_471_-_review_of_scripting_and_the_shell.txt · Last modified: 2013/02/07 14:57 by jchung

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki