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


Click here to return to the 'Execute small bits from the clipboard in Terminal' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Execute small bits from the clipboard in Terminal
Authored by: mario_grgic on Mar 25, '10 07:38:33AM

Someone should also mention that this is a security concern as well esp. when done in the script, since even if you put something on the pasteboard and immediately executed it in the next line, there is a possibility that another application will overwrite or modify your command string.

So, better check what is in the pasteboard before you blindly execute it. Perhaps you put "sudo rm -rf /" in there some time ago :D.



[ Reply to This | # ]
DANGER STOP NO
Authored by: Anonymous on Mar 25, '10 11:26:35AM
Thank you for pointing this out. It's too obvious that ANYTHING can monkey with the pasteboard. You might have copied some innocent text elsewhere that causes a whole trainwreck of grief at the command line.

[ Reply to This | # ]
Execute small bits from the clipboard in Terminal
Authored by: asmeurer on Mar 25, '10 07:17:28PM

Good point. I would recommend against using `pbpaste` in any script for this reason.



[ Reply to This | # ]