I need to run this command fromin a shell script to copy source > destinationcopy source > destination and exclude a folder.
No rsync, tar, find, mv, etc.
Exactly this command:
cp -var test/!(test2) testbkp
- In the shell it works
- Run from a Bash script without exclude like
cp -var test testbkpit works.
When I try to run from a Bash script with the exclude option
cp -var test/!(test2) testbkp, it doesn't work.
There isn't any output, nothing, and no error message.
I checked this post too, but no result: cp command won't run if executed from shell script
How can I run this cp command in a Bash script and exclude folders?