![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Is there any Javascript things for Lynx? | zeus | Security | 7 | 11-10-2007 09:56 PM |
| Question about several things in C | V4D3R | High Level Programming | 1 | 09-13-2007 10:56 PM |
| When things doesn't run into crontab??? | nymus7 | Shell Programming and Scripting | 4 | 04-24-2006 11:11 AM |
| Complicating things? | bconnor | High Level Programming | 1 | 03-30-2006 10:07 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
how to convert things from csh to sh
i have this method in csh that check for file exist.
#check that file exists if ( ! -e $6$5 ) then echo $6$5 Not Found exit 8 endif however i wanted in to be in just sh. so i change the code to: if [ ! -e $6$5 ]; then echo $6$5 Not Found exit 8 fi I get error showing test arguments needed or something like this..is there any problem with my coding? Btw the parameters are passed in...$5 is a text file and $6 is a path name. |
|
||||
|
Put quote around the variable argument in the if staement. eg
if [ ! -e "$6$5" ] The reason you get an error in your own code when $5 and $6 are both empty is that the '-e' test requires an argument. By putting quotes round it you force an argument of a null string (rather than no argument at all) when $5 and $6 are both empty. Last edited by Unbeliever; 10-28-2005 at 10:06 AM.. |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|