From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <102653723422088.tru64-unix-managers.marc@archive.invalid> From: "Liang, Warren" Date: Mon, 28 Jan 2002 23:25:29 +0000 To: tru64-unix-managers Subject: How to 'update' a record X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=102653723422088 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.