Answer the question
In order to leave comments, you need to log in
How to make folder contents copy without specific folders in script?
In the console I enter the following command:
And everything works fine, but in the bash script it writes an error.
Here is the script:cp -r dir/!(build|dist) test/
#!/bin/bash
cp -r dir/!(build|dist) test/
./test.sh: line 3: syntax error near unexpected token `('
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question