public
Last active — forked from defunkt/browser

  • Download Gist
browser
Shell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
#!/bin/sh -e
#
# Usage: browser
# pipe html to a browser
# e.g.
# $ echo "<h1>hi mom!</h1>" | browser
if [ -t 0 ]; then
cat <<usage
Usage: browser
pipe html to a browser
$ echo '<h1>hi mom!</h1>' | browser
$ ron -5 man/rip.5.ron | browser
usage
else
f="/tmp/browser.$RANDOM.html"
cat /dev/stdin > $f
open $f
fi

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.