syntax - Parentheses don't work in Bash script -


i'm writing script needs erase directory except 2 directories, mysql , temp.

i asked question earlier , got code works in command line:

rm -rf !(mysql|temp) 

however doesn't work in script. error "syntax error: "(" unexpected".

is there special parentheses need do?

you need explicitly enable extended patterns in script:

shopt -s extglob 

Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -