Jun 21, 2004 #1 RajShekar Programmer May 27, 2004 14 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 Jul 27, 2000 2,146 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 Thread starter #4 RajShekar Programmer May 27, 2004 14 US I want to assign rc=2 if ls command lists any files. Upvote 0 Downvote
Jun 21, 2004 #5 PHV MIS Nov 8, 2002 53,708 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