Skip to content

Instantly share code, notes, and snippets.

@stephencelis
Created April 26, 2009 20:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stephencelis/102151 to your computer and use it in GitHub Desktop.
Save stephencelis/102151 to your computer and use it in GitHub Desktop.
`open' with stdin
#!/bin/sh
# A better open: with stdin.
if tty -s
then
/usr/bin/open $@
else
while read input
do
/usr/bin/open $input
done
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment