In my deployment script I have such as code to exclude certain files.
shopt -s extglob mv !(deploy.sh|file1|file2) ~/$public
It works almost well but ignores hidden files so they are not moved. How to improve the code to move hidden files too?
There is a
dotglob option in bash exactly for this purpose:
$ touch file1 file2 .file $ ls !(file1) file2 $ shopt -s dotglob $ ls !(file1) .file file2