tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
* How to 'update' a record
@ 2002-01-28 23:25 Liang, Warren
  0 siblings, 0 replies; only message in thread
From: Liang, Warren @ 2002-01-28 23:25 UTC (permalink / raw)
  To: tru64-unix-managers

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.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-01-28 23:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-01-28 23:25 How to 'update' a record Liang, Warren

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