T
T
Tesla4o2019-12-16 13:17:32
linux
Tesla4o, 2019-12-16 13:17:32

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/

Mistake:
./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 question

Ask a Question

731 491 924 answers to any question