Skip to Content.
Sympa Menu

baslinux - Re: [BL] Busybox sed

baslinux AT lists.ibiblio.org

Subject: Baslinux mailing list

List archive

Chronological Thread  
  • From: David Moberg <davidjmoberg AT gmail.com>
  • To: baslinux AT lists.ibiblio.org
  • Subject: Re: [BL] Busybox sed
  • Date: Fri, 25 Nov 2005 10:21:31 -0800

On 11/25/05, Anthony Albert <albert AT umpi.maine.edu> wrote:
> On 25 Nov 2005 at 13:26, mikkel meinike wrote:
> >Busybox sed will not doe what I want it to do. The normal sed can
> >print all the text in a text file that exist from first appetence off
> >"word A" until next appetence off "word B".
> >like this:
> >sed -e '/word A/,/word B/p' myfile.text > an_other_file.text
> >
> >so from file:
> >car, woman, word A, elephant, house, dog, hotdog, word B, gymnastic,
> music.
> >
> >It will print:
> >word A, elephant, house, dog, hotdog, word B
> >1 Do you have a way to do that with busybox sed?

Try:

sed -e '/word A/,/word B/!d' myfile.text > an_other_file.text

> >2 Is there an other busybox tool that does that (what about busybox
> >awk) and if yes how?

I think that awk can. However, it is much more complicated to use.
I have no idea how to use awk to substitute text lines. BL3 busybox
does not even include awk, does it?

> >3 Can I just install the real sed from /a3/bin.tgz ore will it
> >conflict with the busybox sed?

AFAIK, the only problem is if the pkg command does not delete
the exisiting link(s) to busybox. (e.g. /bin/sed -> /bin/busybox,
/bin/cp -> /bin/busybox) In that case it might overwrite busybox
and prevent you from booting BL.

> You can install the read sed from the .tgz, but you'll need to make
> sure that you unlink all links to BusyBox from 'sed', first, or you'll
> overwrite BusyBox - very bad!

I'm not sure if this is still possible in BL3, but I recall some
discussion on the list about this earlier.

> I think it might just be a limitation in BusyBox's sed... most of the
> 'commands' in BusyBox are limited versions, and don't include all the
> options. For example, I found I had to replace 'ls', to get all the
> functionality that I wanted...

BusyBox sed is (except for a few small bugs) compatible with the
Sysv3 sed, which is a very standard sed. No, it does not
implement everything that GNU sed has, but it works well enough.

> Anthony Albert

David




Archive powered by MHonArc 2.6.24.

Top of Page