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
Post a Comment