View Single Post
gobuki's Avatar
Posts: 60 | Thanked: 46 times | Joined on Jan 2010 @ Europe
#23
Originally Posted by lma View Post
Try a pattern matching expression, like this:
Code:
if [ "${my#*bc}" != "$my" ]
Just to mention it: this is a bash feature and not supported by standard shells/busybox.
You should really install a shell with better scripting support if you need regex and follow the countless shell-scripting tutorials on the net - unless maybe you want to deploy it elsewhere. Just make sure you're reading a tutorial for the right shell, since shell scripting != shell scripting.
__________________
Zen master ordering a hotdog: "Make me one with all!"

Last edited by gobuki; 2010-03-11 at 20:29. Reason: added: if you need regex