public inbox for speakup@linux-speakup.org
 help / color / mirror / Atom feed
From: "Laura Eaves" <leaves1@carolina.rr.com>
To: "Speakup is a screen review system for Linux." <speakup@braille.uwo.ca>
Subject: Re: can't invoke sed properly...
Date: Mon, 2 May 2005 16:41:09 -0400	[thread overview]
Message-ID: <058d01c54f57$457b8880$6401a8c0@geekspeak> (raw)
In-Reply-To: <002001c54f54$c8466170$c2a9e744@nedelko83f1172>

Hi Ned --
Well you should probably use

sed -e pattern filename >outfile

But beware of sed.
I once was chasing down an obscure bug in a very large script and between me 
and another person we found that a call to sed was implicitly truncating a 
long line to a built in maximum.
The resulting behavior of the script was quite confusing to say the least.
Sed will give no error message about this, and for must apps you won't run 
into it, but be aware that sed will truncate lines it can't load into its 
buffer.

Now as for your pattern, I believe you can delete the 1,$ as sed should 
cycle through the lines as it is and pass the updated liine to output.
So your line should be:

sed -e 's/red/blue/g' filename >outfile

HTH
--le


----- Original Message ----- 
From: "Ned" <ngranic@cox.net>
To: "Speakup is a screen review system for Linux." <speakup@braille.uwo.ca>
Sent: Monday, May 02, 2005 4:23 PM
Subject: can't invoke sed properly...


Hi all,
I have problemof invoking the sed text editor properly.
How, let's say, would I invoke sed in order to make a substitution in all 
lines of my_file:
sed :1,$ s/red/blue/g my_file
I am writing a bash script and need to test each line outside it first to 
make sure it works.


Many thanks in advance!
Ned
_______________________________________________
Speakup mailing list
Speakup@braille.uwo.ca
http://speech.braille.uwo.ca/mailman/listinfo/speakup 



  reply	other threads:[~ UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
 Ned
 ` Laura Eaves [this message]
 ` Lorenzo Taylor
   ` Laura Eaves
     ` Lorenzo Taylor
     ` Charles Hallenbeck
       ` Laura Eaves
         ` Charles Hallenbeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='058d01c54f57$457b8880$6401a8c0@geekspeak' \
    --to=leaves1@carolina.rr.com \
    --cc=speakup@braille.uwo.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).