searching file for string with embedded space and dash
All -
I'm trying to use grep to find out if file in a ksh script contains the following string:
'spdsnsrv -listenport'
this string is contained in a ksh shell variable see code below:
spds1="'spdsnsrv -listenport'"
while [[ $count -le 3 ]]; do
spds_pid=spds"${count}"
eval grep \$${spds_pid} $PSFILE > /dev/null
...
((count=count+1))
done
I get the following results:
grep: invalid option -- t
Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep --help' for more information.
grep: invalid max count
I have tried it with double quotes around the string, single quotes around the string and no quotes around the string.
How can I fix this?
|