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 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…