Skip to Content.
Sympa Menu

baslinux - [BL] Which sed?

baslinux AT lists.ibiblio.org

Subject: Baslinux mailing list

List archive

Chronological Thread  
  • From: baslinux AT lists.ibiblio.org
  • To: baslinux AT lists.ibiblio.org
  • Subject: [BL] Which sed?
  • Date: Mon, 26 Nov 2007 23:03:29 +0100

I have tried to use sed (Stream Editor) in BL3.50 but get strange errors. E.g.
ps -A | sed ':a;N;$!ba;s/\n//g'
doesn't do anything visible (it should remove newlines).

This doesn't work on sed in BL3.50:
ps -A | sed -e ':a' -e N -e '$!ba' -e 's/\n//g'
One gets the error: 'sed: duplicate label :a'

These works with gsed (GNU sed v3.02) and SEd on BusyBox v1.4.2.

This works on all tested seds:
ps -A | sed ':a
N
$!ba
s/\n//g'

But is a bit long.

If one only wanted to solve this problem one could use:
ps -A | tr -d '\n'

But I want to use loops in one line scripts.

Do you know which version of sed is in BL3.50? Do you know where the source code is?

--
// Mikael




Archive powered by MHonArc 2.6.24.

Top of Page