Subject: | |
From: | |
Reply To: | |
Date: | Thu, 13 Dec 2001 19:51:23 -0500 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
sed 's/oldstring/newstring/' oldfile >newfile
If the newfile does not exist before, the shell will of course create a
bytestream file. If you want it to have the same characteristics as the
oldfile, the easiest thing to do is:
callci copy oldfile, newfile
before the sed
You can
mv newfile oldfile
after the sed to have it replace the old file.
If the file is numbered this will have a bad effect (unless the length of
oldstring and newstring are the same).
----- Original Message -----
From: "Peter Osborne" <[log in to unmask]>
To: <[log in to unmask]>
Sent: Thursday, December 13, 2001 5:06 PM
Subject: String Replacement
> Hello All,
>
> Does anyone know a quick way, with shell script to replace a given string
> with another string in an ASCI or Bytestream file?
>
> Thanks,
> -Pete
>
> * To join/leave the list, search archives, change list settings, *
> * etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
>
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|
|
|