Running this script bash ./cleanup.bash
#!/bin/bash
## going to dir moving stuff
rm -rf !(composer.json|.git)
Gives the error:
cleanup.bash: line 10: syntax error near unexpected token '('
cleanup.bash: line 10: 'rm -rf !(composer.json|.git)'
But if I run in in the terminal directly no problem rm -rf !(composer.json|.git)
I tried stripping out all other lines, still get the error.
How do I enter this correctly in the bash script?
See Question&Answers more detail:os