The open(1) command (man page) provides a -f option, which open's own help says "Reads input from standard input and opens with TextEdit". But, in fact, you can load the data into nearly any application. Simply combine the -f flag with the -a flag:
This hint works in 10.4, and should also work in 10.5. I don't know whether it works in any earlier versions of Mac OS X.
- curl 'http://example.com/encodingerror.html' | open -a 'Hex Fiend' -f
- curl 'http://example.com/example.html' | open -a 'TextMate' -f
- curl 'http://example.com/example.png' | open -a 'Preview' -f
- curl 'http://example.com/example.m4v' | open -a 'QuickTime Player' -f
This hint works in 10.4, and should also work in 10.5. I don't know whether it works in any earlier versions of Mac OS X.
•
[7,082 views]

