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:
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.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
result when try run it:
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?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
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
Post a Comment