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″
remark: need to match exactly Validation word
lidia
You can use
Parameter expansionthat removes everything up to and including Validation and compare that to the normal expansion of the parameter. If they are not equal the parameter contains Validation.(Since there are always spaces before and after Validation these can be included in the pattern. I do not know of an other way to match beginning and end of word in shell patterns)