View Single Post
Old 07-01-2012, 11:11 AM   #43
baf
Addict
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: 332
Karma: 1346560
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