I'm trying to run the following:
x=$(echo "$1" | egrep -c "^[0-9]|[:&^]")
Now, this code is supposed to look for a word that starts with a number, or contains a :,& or ^. However,I geta "no match" error when I run this in UNIX. What makes matters more cofusing is that something similar runs well in terminal, but not in a script.