I am just 6 months old in shell scripting. I am trying to move all directories from one location to another except one in my script When I execute the move command as below it works
mv -vt dir2/ dir1/!(donotmove)
but when I do it like this it fails
des="dir2/"
src="dir1/"
mv -vt $des $src"!(donotmove)"
As my source and destination directories will continuously change I have to use variables. I have tried various combinations but no success
Also executed before executing the above commands
shopt -s extglob
Please let me know where I am making mistake.