Imported from ../bash-2.04.tar.gz.

This commit is contained in:
Jari Aalto
2009-09-12 16:46:53 +00:00
parent b72432fdcc
commit bb70624e96
387 changed files with 28522 additions and 9334 deletions
+16
View File
@@ -0,0 +1,16 @@
exec 9<>/dev/tcp/129.22.8.162/25
read banner <&9
echo "$banner"
echo quit >&9
read msg <&9
echo "$msg"
exec 9<&-
# nifty date command that queries the date/time server
cat < /dev/tcp/129.22.8.102/13
exit 0
+11
View File
@@ -0,0 +1,11 @@
# interactive
# from tty
read -n 3 -p 'enter three chars: ' xyz
echo
echo $xyz
# using readline
read -p 'enter 3 chars: ' -e -n 3 abc
# readline outputs a newline for us, so we don't need the extra echo
echo $abc
+25
View File
@@ -0,0 +1,25 @@
#! /bin/bash
i=0
while [ $i -lt $1 ]
do
/bin/sh -c "sleep 4; exit 0" &
rv=$?
pid=$!
eval bg_pid_$i=$pid
echo $$: Job $i: pid is $pid rv=$rv
i=$((i + 1))
done
i=0
while [ $i -lt $1 ]
do
eval wpid=\$bg_pid_$i
echo Waiting for job $i '('pid $wpid')'
wait $wpid
rv=$?
echo Return value is $rv
i=$((i + 1))
done