Created
September 22, 2011 15:05
-
-
Save ryo1kato/1235002 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
i=0 | |
while :;do echo $((i++)); sleep .3; done | bash -c 'while read L1; do echo L1=$L1; while read -t 0 L2; do echo L2=$L2; break; done; sleep .5; done' | |
# わかりやすくインデントすると | |
while :; | |
do | |
echo $((i++)) | |
sleep .3 | |
done | bash -c 'while read L1; | |
do | |
echo L1=$L1; | |
while read -t 0 L2; | |
do | |
echo L2=$L2; | |
break; | |
done; | |
sleep .5; | |
done' | |
# bashだと内側のループ (while read -t 0 L2) で何も読めない。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment