the following test syntax is part of ksh script

   [[ $PARAM = TRUE ]] &&  [[ ` echo $LINE_FROM_FILE | grep -c Validation ` -eq 1 ]] && print "find Validation word"

Can I get some other creative syntax/solution/command to verify if Validation word exists in LINE_FROM_FILE without to use the echo command?

LINE_FROM_FILE="123 Validation V125 tcp IP=1.2.56.4"

lidia

link|improve this question

feedback

1 Answer

up vote 0 down vote accepted
... && [[ $LINE_FROM_FILE == *Validation* ]] && ...
link|improve this answer
not good because if I have Validatio and not Validation its also match , did you have other solution – lidia Aug 25 '10 at 10:30
Are you sure that this is with ksh then? == should do glob matching, and =~ does regex matching. – Ignacio Vazquez-Abrams Aug 25 '10 at 10:37
try with LINE_FROM_FILE="1 2 3 ValidationWORD" its also match – lidia Aug 25 '10 at 10:58
But that would match with your original command as well. – Ignacio Vazquez-Abrams Aug 25 '10 at 12:07
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.