I'm having problems running a bash script on
zsh. The script is similar to the one below and is supposed to run under bash:
#!/bin/bash echo "<235234>" | egrep -oe [0-9]+
However, my shell is by default on
zsh, so to run the above script what I do is type
/bin/bash on my
zsh prompt, and then I run
However, this results in an error, and I get:
zsh: no matches found: [0-9]+
(I should get
At this point I am confused and have the following questions:
- If I am in
bash, why do I get an error reported by
- Why does the
egrepregexp fail? The regular expression looks correct to me.
Note: In case it matters, I am not supposed to modify the script (the script is shared by multiple users and we are not supposed to make changes to it).