I have 5 files in a directory
log.txt
abc.pdf
def.ppt
1CC
1DD
Now I want to Move files having no extension i.e 1CC and 1DD to a another directory i.e tree.
whenever i am manually using command it will work.
command :
shopt -s extglob
mv !(*.*) tree
but in a bash script it shows the error script :
#/bin/bash
mkdir tree
shopt -s extglob
mv !(*.*) tree/
and saved as stuct.sh after running it
it shows the following error:
struc.sh: line 11: syntax error near unexpected token `('
struc.sh: line 11: `mv !(*.*) tree/'
I have No idea why this is happening. Please provide solution for the same. thanks