tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
From: "Liang, Warren" <warren.liang () marconi ! com>
To: tru64-unix-managers
Subject: How to 'update' a record
Date: Mon, 28 Jan 2002 23:25:29 +0000	[thread overview]
Message-ID: <102653723422088.tru64-unix-managers.marc@archive.invalid> (raw)

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.

                 reply	other threads:[~2002-01-28 23:25 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox