APLawrence - Information and Resources for Unix and Linux Systems, Bloggers and the self-employed
RSS Feeds Get APLawrence.com by RSS









MacOSX Skills Test

Copyright 2002,2003 A.P. Lawrence

Answers


Answer


"fi" needs to be the last line of this script.

Bash shell if statements take the general form of

if somecondition
then
dosomething
else
dosomethingelse
fi
See man bash

What about tcsh? Well, tcsh really is a lousy scripting shell (which is why system shell scripts use sh or bash on almost ALL Unixes including Mac OS X), but that syntax is similar:

if ( expression ) then
  dosomething
  dosomething
else
  dosomethingelse
endif

Comments /Tests/MacOSX/e0106.html


Add your comments


Next question
Return to Question q0106
Get Complete 305 Question Set