Hello:
While reading records from a data file mytest.txt, I like to 'update' the
last record read with another string. I try not to create a new file.
Here is my procedure:
#!/bin/ksh
exec 3< mytext.txt
while read -r -u3 rec1
do
if [[ $rec1 = "obsolete" ]]
then
# update this record by replacing it with a string
"brandnew".
# ?
fi
done
exec 3<&- #close mytext.txt
Thanks in advance.
O/S: DEC Tru64 UNIX V5.0
Shell: Korn shell
Warren.
Received on Mon Jan 28 2002 - 23:31:59 NZDT