The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #5 (permalink)  
Old 04-25-2008
cfajohnson's Avatar
cfajohnson cfajohnson is offline Forum Advisor  
Shell programmer, author
  
 

Join Date: Mar 2007
Location: Toronto, Canada
Posts: 2,378
Quote:
Originally Posted by Ariean View Post
Thanks for your reply, based on your suggestion i tried rewriting the code as below but some how i didn't understand why it is executing the statement in the else part even after the condition in the if statement is true or satisfied or pmcmd command getting executed. Could you please throw some light. Thank you.

==================

#!/bin/ksh
for file in /export/home/orainfodev/sam s ; do

Do you really intend to loop over two files, "/export/home/orainfodev/sam" and "s"?

If that is intended to be a single file, it needs to be quoted. And, if so, why are you using a loop?