Skip to main content

Thread: Shell script difficulties


it has become weekly chore me clean out downloads directory of .iso, .jpg, , .pdf files i've downloaded. there others clean out, 3 seem make vast majority of clutters up. got bright idea try , make script organize them all. seems did so....poorly...

here's script:
code:
#!/bin/bash    mv /home/chris/downloads/"*.iso" /home/chris/downloads/disk_images    mv /home/chris/downloads/"*.pdf" /home/chris/documents/ebooks    mv /home/chris/downloads/"*.jpg" /home/chris/pictures/to_be_sorted
now won't lie, have no idea why isn't working. it's supposed move files in downloads end in .iso/pdf/jpg specific sections.

result when try run it:
code:
mv: cannot stat `/home/chris/downloads/*.iso': no such file or directory  mv: cannot stat `/home/chris/downloads/*.pdf': no such file or directory  mv: cannot stat `/home/chris/downloads/*.jpg': no such file or directory
i'll assume it's failing because can't locate specified files, in there, , isn't "*.jpg" supposed mean every combination of letters/numbers, , .jpg?

in advance help, believe case scripting newbie trying waaaay on head.

might @ directory names, make sure caps/no caps correct


Forum The Ubuntu Forum Community Ubuntu Official Flavours Support New to Ubuntu [SOLVED] Shell script difficulties


Ubuntu

Comments

Popular posts from this blog

How to change text Component easybook reloaded *newbee* - Joomla! Forum - community, help and support

After Effect warning: A problem occurred when processing OpenGL commands

Preconditions Failed. - Joomla! Forum - community, help and support