Last active
August 21, 2017 09:20
-
-
Save tex2e/f7a4e14ba0d9bf428c5ab4e6ed29e014 to your computer and use it in GitHub Desktop.
コマンド実行時に標準入力が与えられているか調べる
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 | |
if [ ! -p /dev/stdin ]; then | |
echo "no stdin data" 1>&2 | |
exit 1 | |
fi | |
# ... | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment