Thanks for the replies guys.
I've given the
if [[ $haystack = $needle ]]
a try without success. I've had to use a single [ ] pair though. I've tried some variants such as . . .
if [ "$haystack" = "$needle" ]
if [ "$haystack" = "$needle" ]
without success. This is all needed on a Windows NT box with MKS toolkit, so it's not a true *nix machine. It's not my server either and PHP is not installed (what are they thinking? - I don't know). It's all to support some legacy systems.
Not to worry, as I've been using the following which seems to work although I'm sure there is a better way:
.
.
ISREPRINT=echo $MYFILE | grep "BIL" | wc -l | sed "s/ *//g"
if [ "$ISREPRINT" = 0 ];then
.
.
where $MYFILE is the Haystack and "BIL" is the needle.
Thanks for the posts though.
A.