View Single Post
Old 07-01-2012, 10:11 AM   #43
baf
Evangelist
baf ought to be getting tired of karma fortunes by now.baf ought to be getting tired of karma fortunes by now.baf ought to be getting tired of karma fortunes by now.baf ought to be getting tired of karma fortunes by now.baf ought to be getting tired of karma fortunes by now.baf ought to be getting tired of karma fortunes by now.baf ought to be getting tired of karma fortunes by now.baf ought to be getting tired of karma fortunes by now.baf ought to be getting tired of karma fortunes by now.baf ought to be getting tired of karma fortunes by now.baf ought to be getting tired of karma fortunes by now.
 
Posts: 404
Karma: 2200000
Join Date: May 2012
Device: kt
Strange. Your code works for me:

Code:
#!/bin/sh
image="test test";
echo "$image" | grep -q " ";
if [[ $? -eq 0 ]]
then
 echo "found";
fi
As well as this:

Code:
#!/bin/sh
image="test test";
case $image in
  *' '*) echo "found space" ;;
  *)   echo "not found" ;;
esac
baf is offline   Reply With Quote