I have just recently started with Bash scripting, and i am trying to move files according to their file extension. Directly at the bash prompt i can do like this:
but if i try the same in my script i get a syntax error, this is what the script look like:Code:mv *+(.jpg|.jpeg|.gif|.png) ./pictures
Why is that?Code:mv *+(.mp3) ./music mv *+(.jpg|.jpeg|.gif|.png) ./pictures mv *+(.doc|.pdf|.odt|.txt) ./document mv *+(.deb|.zip|.gz) ./packets mv *+(.iso) ./iso-files exit 0
Bookmarks