It depends on the sed...

For example, an update in place from Unix style end of lines to the
Windows carriage return style for some files.

  sed -i 's/$/\r/' filename

works on sles9 and fedora core 3, but not sles8

~ Daniel

-----Original Message-----
From: Linux on 390 Port [mailto:[EMAIL PROTECTED] On Behalf Of
Mark Perry
Sent: Wednesday, January 19, 2005 1:49 PM
To: [email protected]
Subject: Re: Character mode text editor

I don't believe that sed will do an in-place edit. Hence you must pipe
the
output to another file.

All the Best
Mark Perry


> -----Original Message-----
> From: Linux on 390 Port [mailto:[EMAIL PROTECTED] On Behalf Of
> Fargusson.Alan
> Sent: Wednesday, January 19, 2005 5:27 PM
> To: [email protected]
> Subject: Re: Character mode text editor
> 
> For this it would seem that sed would be a little lighter.  Off the
top of
> my head:
>       sed s/fred/joe/g
> 
> I didn't test this.  You may need a -e or something.
> 
> -----Original Message-----
> From: Linux on 390 Port [mailto:[EMAIL PROTECTED] Behalf Of
> Mark Perry
> Sent: Wednesday, January 19, 2005 2:18 AM
> To: [email protected]
> Subject: Re: Character mode text editor
> 
> 
> On the very few occasions that I have made a mistake to an /etc ASCII
boot
> file (ok more than a few times), I have used Perl from the command
line to
> make simple changes and hence avoid a true editor.
> 
> If you use the -i option it even makes a backup for you, plus it can
> update
> multiple files in one pass.
> 
> Example to change the string "fred" to "joe" (what you expected
foobar?)
> in
> all files beginning "start" in the current subdirectory try the
following:
> 
> perl -p -ibackup -e's/fred/joe' start*
> 
> I would suggest that you experiment with non critical files first ;-)
> 
> All the Best
> Mark Perry
> 
> 
> > -----Original Message-----
> > From: Linux on 390 Port [mailto:[EMAIL PROTECTED] On Behalf
Of
> > Seader, Cameron
> > Sent: Tuesday, January 18, 2005 10:36 PM
> > To: [email protected]
> > Subject: Re: Character mode text editor
> >
> > vi does not work on a vm console when you are logged onto linux from
> > there.
> 
> ----------------------------------------------------------------------
> For LINUX-390 subscribe / signoff / archive access instructions,
> send email to [EMAIL PROTECTED] with the message: INFO LINUX-390
or
> visit
> http://www.marist.edu/htbin/wlvindex?LINUX-390
> 
> ----------------------------------------------------------------------
> For LINUX-390 subscribe / signoff / archive access instructions,
> send email to [EMAIL PROTECTED] with the message: INFO LINUX-390
or
> visit
> http://www.marist.edu/htbin/wlvindex?LINUX-390

----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or
visit
http://www.marist.edu/htbin/wlvindex?LINUX-390

----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390

Reply via email to