0

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

lidia
  • 919
  • 1
  • 9
  • 9

2 Answers2

0
... && [[ $LINE_FROM_FILE == *Validation* ]] && ...
0

if the word separator in the "line from file" is always one or multiple spaces, try this:

if [[ " $LINE_FROM_FILE " == *" Validation "* ]] 

do'nt forget the quotes