Thanks,
Nasir (part of code is below)
while read dir prefix URL ####### PARENT LOOP
do
cd $dir/config
cp -p obj.conf obj.conf.nasir
########## EDITING THE FILE HERE ###########
print NameTrans fn='"redirect"' from='"'$prefix'"'
url='"'$URL'"' > $MY_DIR/text_line
IFS=:
while read whole_line ######## CHILD LOOP
do
if [[ whole_line = '<This>' ]]
then
echo $whole_line > testfile.third
print NameTrans fn='"redirect"' from='"'$prefix'"'
url='"'$URL'"' > testfile.third
else
echo $whole_line > testfile.third
done < testfile ####### The parent loop is ended
here instead of the child loop
### $MY_DIR/testfile < `sed -f $MY_DIR/sed-scr $MY_DIR/testfile`
echo "The value of prefix is $prefix and the URL is $URL"
echo "Working in directory $dir/config now ..."
cd $dir ; ./restart
echo "Working on direcotry $dir DONE successfully."
echo ++++++++++++++++++++++++++++++++++++++++++
done < $filename
Sent via Deja.com http://www.deja.com/
Before you buy.
- and I found that the read from the screen was ignored, the script took the
answer from the next line of the <filename>.
Hope this helps you understand it, and maybe you can code around. I'll
watch your post for an answer from a true guru.
JB
<rog...@my-deja.com> wrote in message news:90grg2$et4$1...@nnrp1.deja.com...
Don't you need a "fi" here to close the else ?
> done < testfile ####### The parent loop is ended
> here instead of the child loop
>
> ### $MY_DIR/testfile < `sed -f $MY_DIR/sed-scr $MY_DIR/testfile`
> echo "The value of prefix is $prefix and the URL is $URL"
> echo "Working in directory $dir/config now ..."
> cd $dir ; ./restart
> echo "Working on direcotry $dir DONE successfully."
> echo ++++++++++++++++++++++++++++++++++++++++++
> done < $filename
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
--
___________________________________________________________________________
Paul R. Brandariz E-mail Internet: bran...@lore.kla-tencor.com
KLA-Tencor Corporation
One Technology Dr.
Milpitas, CA 95035
[original code snipped]
I agree with your assessment. If you are using the Korn shell, I
believe the read command supports the ability to read from a specific
descriptor using the -u option. So the solution would be to use "exec"
to associate one of the input files with a descriptor (other than 0)
and read from that specific descriptor.
while read -u3 record
do
# do work
done 3<input.dat
If you're using the Bourne shell, you'll have to do something more
complicated (save stdin in another descriptor, make stdin point to your
input file, do work using stdin, undo everything):
exec 3<&0
exec < input.dat
while read record
do
# do work
done
exec 0<&3 3<&-
HTH...