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
#!/usr/bin/env bash | |
function throw(){ | |
local msg="${1}" | |
_ERR_MSG_="$msg" | |
kill -s USR2 $BASHPID | |
} |
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
#!/usr/bin/env bash | |
function pipe_in_python() { | |
python -c "$(cat <<EOPY | |
import sys | |
for line in sys.stdin: | |
print line.replace( 'asdf', 'ASDF' ), | |
EOPY | |
)" |
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
tmp=$(cat <<EOPY | |
import sys | |
for line in sys.stdin: | |
print line.replace( 'asdf', 'ASDF' ) | |
print(line) | |
EOPY) | |
echo "asdf.asdf.asdf.e" | python -c "$tmp" |
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
#!/usr/bin/env bash | |
function test_num(){ | |
sleep $(( $RANDOM % 5 )) | |
echo $i | |
} | |
function echo_num(){ | |
for (( i=1; i<=49; i++ )) | |
do |