You are not logged in.
I've written a really basic script just to check what new music was added to my library over the past n days:
#!/bin/bash
echo "Check for days?"
read days
`find /home/tom/Music/ -iname "*.*" -type f -mtime -$days -print`
If I run the find from the shell it runs fine but the script always gives this error:
./listNewMusic.sh: line 7: /home/MrGone/Music/Smod/SModcast-19.mp3: Permission denied
Anyone know why?
Thanks.
Offline
It is because you're running the find command in a sub-shell. What is returned by the sub-shell is being run by your script.
Change:
`find /home/tom/Music/ -iname "*.*" -type f -mtime -$days -print`
to
find /home/tom/Music/ -iname "*.*" -type f -mtime -$days -print
Last edited by steve___ (2010-07-10 12:50:38)
Offline
Thanks, works a treat!
Offline