Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • If 'users' are running this script, -path ~/FileSniper* refers to their home directory. Also, try putting the full path to find instead of find like: /usr/bin/find also you are echoing to a file without putting the full path to the file. Try fixing all the relative path issues and possible $PATH issues and see if that fixes it. Once you have done these fixes, and if it still doesn't work, it might be easier to debug it. Commented Nov 9, 2015 at 2:45
  • is there a reason for ~/* ? are you trying to exclude hidden . directories? you could do find ~ -not -path '*/.*' ... instead. Commented Nov 9, 2015 at 2:56
  • i would also advise taking the input as command-line arguments rather than prompting and reading stdin - that way it's easier to re-use your script from other scripts just by calling it as, e.g., scriptname.sh mp3 mp4 exe sh Commented Nov 9, 2015 at 3:05