Created
August 30, 2014 07:11
-
-
Save aloon/c84b90ca06ee4c2e2771 to your computer and use it in GitHub Desktop.
Simple shell script to test STDIN and STDOUT
This file contains hidden or 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/sh | |
if [ -t 0 ]; then | |
echo nothing in STDIN | |
else | |
while read LINE; do | |
echo ${LINE} | |
done | |
exit 0 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment