You're right Simon, Unicodes are two fold. And also I don't know if 'sed' can 
edit a binary stream :?
However, in computer academic world, streams are bytes even if they are not 
letters e.g. 0x00 and I'm not sure why it's named 'stream editor' instead of 
e.g. 'tsed'(text stream editor).

Actually, that expression which I mentioned is a bit complicated for who see 
'sed' for first time; however, your one is almost completely unknown for me at 
this time :S but now, I know enugh about 'sed' to continue with LFS ;)

--Yasser

From: delga...@ihug.co.nz
To: lfs-support@linuxfromscratch.org
Date: Mon, 7 May 2012 21:00:28 +1200
Subject: Re: [lfs-support] Shoul I remember (keep in mind) all steps?!

On Sun, 2012-05-06 at 21:02 +0430, Yasser Zamani wrote:
> Thanks a lot Simon,
> 
> As I cited, the book is well described enough but I worried a bit when
> I saw a 'sed' script at first time. However, as the mailing list's
> friends advised, after learning a bit online, now I don't have any
> trouble with 'sed' expressions at book :)
> 
> Here, I would like to write down what I learned just in few lines for
> helping whom reach this thread via searching the mailing list:
> 
>      1. sed stands for 'stream editor'
>      2. Streams are bytes which are traveling e.g. byte[] is an array
>         but when you send it's items one by one to a destination then
>         it's a stream.
 
Better to say characters, than bytes. They *are* bytes, of course, but
as a tool for dealing with text, sed views the stream as a stream of
characters. And a character isn't always a single byte.
 
>              1. Exampl 2: echo 'Welcome to LFS' | sed 's@[A-Z]@*&@g'
>                      1. A bit more complicated, right? but not at all
>                         when I describe it:
 
Oh, that's not complicated at all. Somewhat offtopic for LFS, but try
this one, used in a script I wrote for work... basically it parses and
reformats the output of our version control tools...
 
  sed -n '
    /version ".*"/h;
    /activity:.*@/{
      H; g
      s/.*version "\(.*\)".*activity:\(.*\)@\/vobs.*/\2 - \1/
      p
    }'
 
 
Simon.

-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page                                     
  
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page

Reply via email to