Date: Tue, 25 Aug 2020 23:02:47 +0200 From: Christoph Kukulies <kuku@kukulies.org> To: Ruben via freebsd-questions <freebsd-questions@freebsd.org> Subject: Re: Sed pattern help - not FreeBSD related Message-ID: <5EFD7C16-FAB5-4CBC-B06A-B0EA6F6BC5BA@kukulies.org> 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
[-- Attachment #1 --]
Excuses, the result should look like: (forgot the DC)
> LOOP: DC LOOP+2
> DO: DC DO+2
> J: DC J+2
> ENCL: DC ENCL+2 PDP-11 VERSION OF ENCLOSE
> KEY DC KEY+2
> EMIT DC EMIT+2
> QTERM DC QTERM+2
> Am 25.08.2020 um 22:00 schrieb Christoph Kukulies <kuku@kukulies.org>:
>
> Excuses for asking a sed problem only without relation to FreeBSD:
>
> 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
> With a sed command I will make it become:
>
> LOOP: DC LOOP+2
> DO: DC DO+2
> J: DC J+2
> ENCL: DC ENCL+2 PDP-11 VERSION OF ENCLOSE
> KEY DC KEY+2
> EMIT DC EMIT+2
> QTERM DC QTERM+2
>
> In other words, the "*" should be replaced by the label in front of the line.
> In case the line contains something after "+2“ (a comment), it should be appended.
>
> The following sed command doesn’t work. Please no awk,perl,python or other script :)
>
> $ sed 's/\(^[A-Z0-9]*\)\(:?\)\([ \t]*\)\(DC \*\+2\)\(.*$\)/\1\2\3DC \1+2/\5’ <el2
>
>
> Thanks in advance,
>
> —
> Christoph
>
>
>
[-- Attachment #2 --]
0 *H
010
`He 0 *H
00xU!`0
*H
0f10 UDE1301U
*DGN Deutsches Gesundheitsnetz Service GmbH1"0 Udgnservice CA 2 Type E:PN0
200516152759Z
210516152759Z0o10 UDE1!0U400000005ec008dd373ad8ec10UChristoph Kukulies1 0 *H
kuku@kukulies.org0"0
*H
0
yF(Y-0h>?S^@ؗH]hY܀J&uibCK[O'[g<8!KzDR
/[r`a:`t|\i|{ ;yjO+KiֲHe|iyH
#rwzrJQl>%;V) Ѿ_ע͠]E2cfGS3]ǯpv 7030Uu ( ˗V6n 0U0 0U#0Ɠdrj>TTy0VU O0M0K++0;09+-http://sec5.dgnservice.de/policies/index.html0>U705031/-http://sec5.dgnservice.de/crl/crl2-type-e.crl0U0U%0++0U0kuku@kukulies.org0
*H
-@Q72R#:%ɧTcu1TJ2 #&.$Ѫ#Q9Ztx}n{$;E]H|E\@xJ=QKjmS8=|*N
RO>SLLQƗ@0#̘Kȗ,_ZԌ G*l]AJܙPdMDEjC&SKRtF0d5
ڌ>מ ppّ;{_"+050UJf%0
*H
0a10 UDE1301U
*DGN Deutsches Gesundheitsnetz Service GmbH10Udgnservice Root 7:PN0
161026092241Z
241026092241Z0f10 UDE1301U
*DGN Deutsches Gesundheitsnetz Service GmbH1"0 Udgnservice CA 2 Type E:PN0"0
*H
0
ܥ?tǣGҗfkmaw{8㓬END'+k
CNWc$н.rPR@_%x*c]3% t:djʘ:"v?MWp- !?:o2}/f\Wh!Kl |\:OE@dF!Dq#A@
u?o@00يҾCQz6nܶ6oMRZ Buӛ؎["e~@ 00U0 0U#0tr<&wIS0[+O0M0K+0?http://rocsp-dgn.dgnservice.de:8080/ejbca/publicweb/status/ocsp0jU c0a0_++0O0M+Ahttp://www.dgnservice.de/trustcenter/public/dgnservice/index.html0U00ldap://ldap.dgnservice.de:389/CN=CRL-1,O=DGN%20Service%20GmbH,C=DE?certificateRevocationList?base?objectClass=cRLDistributionPoint0UƓdrj>TTy0U0 +m0
+m0
*H
9ESj#55Gܩ
_EҮ"]+8F:
gV6}F+QOKW'B^DRtHxwcPO\a&J{yUdM//6n!:^
&6֗q&Chtjw;4A,+t8h{:|yl:+/6?4z1);݁ݻSjk-oǟp(IJ(ko1
100r0f10 UDE1301U
*DGN Deutsches Gesundheitsnetz Service GmbH1"0 Udgnservice CA 2 Type E:PNU!`0
`He s0 *H
1 *H
0 *H
1
200825210247Z0/ *H
1" r"9y`,2snZB4-kc]Ě0 +71t0r0f10 UDE1301U
*DGN Deutsches Gesundheitsnetz Service GmbH1"0 Udgnservice CA 2 Type E:PNU!`0*H
1tr0f10 UDE1301U
*DGN Deutsches Gesundheitsnetz Service GmbH1"0 Udgnservice CA 2 Type E:PNU!`0
*H
DX%Q1UT$4Tn[TO=wA֑0,Mbs{M8<L>]QX
Ԙhz- thx;", :(B4ool=ΤLP:n>)8B%ho`
.nMq.MgI)@@U zJbxǠUE%u0e96P?{tPol9t~TF TH I
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5EFD7C16-FAB5-4CBC-B06A-B0EA6F6BC5BA>
