Shell Script for checking existence of a directory -


if[-d /abmusr06/abm/users/dywrk01/run_time];         echo "pack installation failed"      exit(1) fi 

this above code fine?

assuming bourne shell (/bin/sh):

if [ -d /abmusr06/abm/users/dywrk01/run_time ]     echo "pack installation failed"     exit 1 fi 
  • put spaces around brackets: if [ -d. think of [ (key)word - needs stand itself. wouldn't ls-l, ls(space)-l.
  • use exit 1, not exit(1).
  • the semicolons unnecessary if on separate lines.
  • the above seems work in cygwin me.

Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -