home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / unix / shell / 5518 < prev    next >
Encoding:
Internet Message Format  |  1993-01-28  |  997 b 

  1. Path: sparky!uunet!spool.mu.edu!agate!doc.ic.ac.uk!uknet!axion!muppet!qdos!mick
  2. From: mick@muppet.bt.co.uk (Mick Burnell)
  3. Newsgroups: comp.unix.shell
  4. Subject: Re: Another sed question.
  5. Message-ID: <1993Jan28.092332.23686@muppet.bt.co.uk>
  6. Date: 28 Jan 93 09:23:32 GMT
  7. References: <1993Jan27.204753.23339@nmsu.edu>
  8. Sender: news@muppet.bt.co.uk
  9. Reply-To: mick@muppet.bt.co.uk
  10. Organization: British Telecom
  11. Lines: 20
  12.  
  13. In article 23339@nmsu.edu, jsz@scf.nmsu.edu (Henri De Valois) writes:
  14. >
  15. > I am trying to write a script,that would append to each EOL
  16. > some string,say `blah'. but when I do "sed -e 's/^/blah/g' inputfile > outputfile"
  17. > `blah' inserts at the begining of each line.
  18. >
  19.  
  20.  
  21. Try   sed -e 's/$/blah/g'
  22.  
  23.  
  24.      ^    As the leftmost character, a caret (or circumflex) con-
  25.           strains the RE to match the leftmost portion of a line.
  26.  
  27.      $    As the rightmost character, a  dollar  sign  constrains
  28.           the RE to match the rightmost portion of a line.
  29.  
  30.  
  31. Hope this helps,
  32.         Mick.
  33.