tomerps
asked on
Unix ls --- No such file or directory
I need to capture the condition when jversion returns No such file or directory... ..
jversion=`ls -1td /sbcimp/run/tp/sun/jre/*-64bit* | head -1 | cut -d'/' -f7 | sed 's/v//' | tr -s " " | sed 's/^[ ]//g'`
if [????]
else
fi
is No such file or directory returned in $jversion? or is $jversion blank when ls -1td /sbcimp/run/tp/sun/jre/*-6 4bit* prints No such file or directory on stderr?
ASKER
Hi ozo, thanks for asking...it is done now. i captured the condition with followig code
if [ "$jversion" = "No match" ] || [ "$jversion" = "0" ] || [ "$jversion" = "" ]
then
....
if [ "$jversion" = "No match" ] || [ "$jversion" = "0" ] || [ "$jversion" = "" ]
then
....
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I think ozo answered and should be rewarded to some degree.
agreed
ASKER
n/a
Do as you like. I was not involved until the end - on points and fairness only. I think ozo's answer is perectly valid and shows how the pipes work; beyond that he/she deserves some credit.