Jun 21, 2004 #1 RajShekar Programmer Joined May 27, 2004 Messages 14 Location US I want the below statement to return the value 2 if the ls command returns any files? rc=$(rsh -l dmnida kdnidp02 "ls ${ZW_MONTHLY_PATH}${SD_FILE}.sum 2>/dev/null
I want the below statement to return the value 2 if the ls command returns any files? rc=$(rsh -l dmnida kdnidp02 "ls ${ZW_MONTHLY_PATH}${SD_FILE}.sum 2>/dev/null
Jun 21, 2004 #2 vgersh99 Programmer Joined Jul 27, 2000 Messages 2,146 Location US untested.... Code: rc=$(rsh -l dmnida kdnidp02 "if [ -f ${ZW_MONTHLY_PATH}${SD_FILE}.sum ]; then echo 2;fi;) vlad +----------------------------+ | #include<disclaimer.h> | +----------------------------+ Upvote 0 Downvote
untested.... Code: rc=$(rsh -l dmnida kdnidp02 "if [ -f ${ZW_MONTHLY_PATH}${SD_FILE}.sum ]; then echo 2;fi;) vlad +----------------------------+ | #include<disclaimer.h> | +----------------------------+
Jun 21, 2004 #3 PHV MIS Joined Nov 8, 2002 Messages 53,708 Location FR return the value 2 where ? Upvote 0 Downvote
Jun 21, 2004 Thread starter #4 RajShekar Programmer Joined May 27, 2004 Messages 14 Location US I want to assign rc=2 if ls command lists any files. Upvote 0 Downvote
Jun 21, 2004 #5 PHV MIS Joined Nov 8, 2002 Messages 53,708 Location FR Ah, OK you may try this: rc=$(rsh -l dmnida kdnidp02 "ls ${ZW_MONTHLY_PATH}${SD_FILE}.sum 2>/dev/null") [ -z "$rc" ] || rc=2 Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244 Upvote 0 Downvote
Ah, OK you may try this: rc=$(rsh -l dmnida kdnidp02 "ls ${ZW_MONTHLY_PATH}${SD_FILE}.sum 2>/dev/null") [ -z "$rc" ] || rc=2 Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244