for file:
$ cat $tempfile
a b
c d
e f
g h
In ksh:
#!/bin/ksh
exec 4<$tempfile
while read -u4 first second
do
echo first=$first
echo second=$second
printf "number?: "
read NUM
echo "name=$NUM"
ssh localhost uname 2>/dev/null
done
in bash:
#!/bin/bash
exec 4<$tempfile
while read <&4 first second
do
echo first=$first
echo second=$second
printf "number?: "
read NUM
echo "name=$NUM"
ssh localhost uname 2>/dev/null
done
exec 4<&-
ksh: http://unix.derkeiler.com/Newsgroups/comp.unix.shell/2003-05/0889.html
bash: http://forums.devshed.com/unix-help-35/bash-scripting-using-file-descriptors-154812.html