Skip to content

Instantly share code, notes, and snippets.

@zuriby
Last active December 14, 2015 08:38
Show Gist options
  • Save zuriby/5059550 to your computer and use it in GitHub Desktop.
Save zuriby/5059550 to your computer and use it in GitHub Desktop.
#myscript.sh
while read line; do
echo "$line" | awk '{print "first Field:"$1}'
echo "$line" | tee -a /tmp/myfile.log | tr ['a-z'] ['A-Z']
done
#! /bin/bash
cat - | awk '{print "here come my long line aws statement:"$1}'
stdin=$(cat -)
echo $stdin | awk '{print "here come my long line aws statement:"$1}'
echo '----------'
# do smore things with stdin
echo $stdin | tr ['a-z'] ['A-Z']
----8<---- INVOKE ----8<-----
$ cat /dev/urandom | hexdump | ./mscript.sh
----8<---- STDOUT ----8<-----
first Field:0001360
0001360 78B4 1FB9 C55F 2910 D69C 0C16 0D8E 4458
first Field:0001370
0001370 D851 C3E7 D849 858B B6A8 732A 76CB FC5D
first Field:0001380
0001380 3516 F665 D435 29AB AC50 5DFF C778 6D58
----8<---- tail /tmp/myfile.log -------8<--------
...
0001360 78b4 1fb9 c55f 2910 d69c 0c16 0d8e 4458
0001370 d851 c3e7 d849 858b b6a8 732a 76cb fc5d
0001380 3516 f665 d435 29ab ac50 5dff c778 6d58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment