Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Create a screenshot and display it immediately' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Create a screenshot and display it immediately
Authored by: aalegado on Jan 04, '06 08:41:34AM
IMHO: I wouldn't use
rm -rf
in the script to delete an existing screenshot file...there's no need for recursion especially since the exact file's path is known. With the '-r' (recurse all sub-directories) switch on, there is potential for disaster if the script is typed in wrong, e.g.
rm -rf ~ /grab.jpg
Note the space. With this particular typo, the script will wipe out one's home directory. Better to use
rm -f ~/grab.jpg
.

[ Reply to This | # ]
Create a screenshot and display it immediately
Authored by: kbradnam on Jan 04, '06 10:27:33AM

Actually, I don't think there is any need for the 'rm' line at all. If you specify a file for the screencapture to write to, and that file already exists, then it will just be overwritten. A safer alternative.



[ Reply to This | # ]