Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Aug 2020 01:46:52 +0530
From:      Manish Jain <bourne.identity@hotmail.com>
To:        Christoph Kukulies <kuku@kukulies.org>, Ruben via freebsd-questions <freebsd-questions@freebsd.org>
Subject:   Re: Sed pattern help - not FreeBSD related
Message-ID:  <DB8PR06MB6442171A088CBCF1146A13E3F6570@DB8PR06MB6442.eurprd06.prod.outlook.com>
In-Reply-To: <6B02E882-D3EE-4721-B572-BFAF5C6BAC66@kukulies.org>
References:  <6B02E882-D3EE-4721-B572-BFAF5C6BAC66@kukulies.org>

next in thread | previous in thread | raw e-mail | index | archive | help


On 2020-08-26 01:30, Christoph Kukulies wrote:
> I have a file el2 with the following content:
> 
> LOOP:	DC *+2
> DO:	DC *+2
> J:	DC *+2
> ENCL:	DC *+2  PDP-11 VERSION OF ENCLOSE
> KEY	DC *+2
> EMIT	DC *+2
> QTERM	DC *+2
> 
> 

There appears a problem in the LOOP line below.

> With a sed command I will make it become:
> 
> LOOP:   DC LOOP+2 
> DO:	DO+2
> J:	J+2
> ENCL:	ENCL+2  PDP-11 VERSION OF ENCLOSE
> KEY	KEY+2
> EMIT	EMIT+2
> QTERM	QTERM+2


Hi Christoph,

I think the LOOP line is wrong : perhaps, you meant

 > LOOP:   LOOP+2

If that is so, you can use the following command :

sed 's/^\(..*\):\([[:space:]]*\)DC[[:space:]]*\*/\1:\2\1/' <file>


Regards,
Manish Jain



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?DB8PR06MB6442171A088CBCF1146A13E3F6570>