Read data from std in and show in a browser
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Read data from std in and show in a browser. | |
# | |
# E.g. curl google.com | bcat | |
# | |
EXT=${1:-.html} | |
TMPFILE=`mktemp '/tmp/bcat.XXXXXXXX'`"$EXT" || exit 1 | |
cat > $TMPFILE | |
/Applications/Safari.app/Contents/MacOS/Safari $TMPFILE 2> /dev/null | |
rm $TMPFILE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment