Skip to content

Instantly share code, notes, and snippets.

@yao2030
Created September 26, 2013 07:54
Show Gist options
  • Save yao2030/6711097 to your computer and use it in GitHub Desktop.
Save yao2030/6711097 to your computer and use it in GitHub Desktop.
ex01.sh for ex02.sh
#!/usr/bin/sh
pipe=/tmp/out
#if [[ ! -p $pipe ]]; then
# echo "Reader not running"
# exit 1
#fi
while true
do
ip=`hostname -i`
date=`date +"%d/%b/%Y:%k:%M:%S %z"`
r=$RANDOM;
random=$(($r+10000000))
time=$[RANDOM % 200 + 10]
echo "[$ip [$date] \"$random\" time=${time}ms]" > $pipe
sleep 0.01
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment