On 09/26/03 14:21 -0500, Bill Gradwohl wrote: > John: > Thanks for the attempt, but the above doesn't work as expected. That was the first thing I tried early on. > Bill, This seems to work (credit to Advanced Bash-Scripting Guide, section 16.1, "Using exec"): #!/bin/bash cat >/tmp/junkfile <<-"CODE" line 1 line 2 line 3 CODE declare -a RULES i=0 j=4 exec 6<&0 # Link file descriptor # 6 with stdin exec </tmp/junkfile # stdin replaced by /tmp/junfile read RULES[0] read RULES[1] read RULES[2] echo ${RULES[0]} echo ${RULES[1]} echo ${RULES[2]} rm -r /tmp/junkfile exec 0<&6 6<&- # Restore stdin from fd #6 echo -n "Enter data: " # Test restore read b1 echo $b1 John -- Shrike-list mailing list Shrike-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/shrike-list