🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.os.linux
Article #904740

Re: Problem z sed

#904740
From: jn
Date: Mon, 07 Jun 2021 23:40
39 lines
2593 bytes
W dniu 06.06.2021 o 23:45, Jarosław Sokołowski pisze:
> jn pisze:
> 
>> Nie umiem zmusić sed do usunięcia nawiasów () wraz z zawartością.
> 
> sed s/\(.*\)//g
> 

Dziękuję ale nie działa tak jak sobie zakładałem.

$ tail /var/log/apt/history.log -n 100 | grep Install:
Install: linux-image-5.4.0-74-generic:amd64 (5.4.0-74.83, automatic), 
linux-modules-extra-5.4.0-74-generic:amd64 (5.4.0-74.83, automatic), 
linux-headers-5.4.0-74:amd64 (5.4.0-74.83, automatic), 
linux-headers-5.4.0-74-generic:amd64 (5.4.0-74.83, automatic), 
linux-modules-5.4.0-74-generic:amd64 (5.4.0-74.83, automatic)
Install: apngasm:amd64 (2.91-1build1)

-------------------------------------------------------------------

$ tail /var/log/apt/history.log -n 100 | grep Install: | sed 
's/:amd64//g;s/Install://g'
  linux-image-5.4.0-74-generic (5.4.0-74.83, automatic), 
linux-modules-extra-5.4.0-74-generic (5.4.0-74.83, automatic), 
linux-headers-5.4.0-74 (5.4.0-74.83, automatic), 
linux-headers-5.4.0-74-generic (5.4.0-74.83, automatic), 
linux-modules-5.4.0-74-generic (5.4.0-74.83, automatic)
  apngasm (2.91-1build1)

--------------------------------------------------------------------

$ tail /var/log/apt/history.log -n 100 | grep Install: | sed s/\(.*\)//g
Install: linux-image-5.4.0-74-generic:amd64
Install: apngasm:amd64

--------------------------------------------------------------------

Chciałem zostawić w wierszu tylko nazwy pakietów
np. linux-image-5.4.0-74-generic oddzielone spacjami.
Technical Details
Message-ID: <s9mapj$qnk$1$pk@news.chmurka.net>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!news.chmurka.net!.POSTED.apn-37-249-253-52.dynamic.gprs.plus.pl!not-for-mail
References: <1fmviwwdpucgq$.m0xwrf6k91f6$.dlg@40tude.net> <s9ihqv$kf3$1$pk@news.chmurka.net> <s9jec8$42g$1$pk@news.chmurka.net> <slrnsbqggn.72r8.jaros@falcon.lasek.waw.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!news.chmurka.net!.POSTED.apn-37-249-253-52.dynamic.gprs.plus.pl!not-for-mail
From: jn <jn@mail.invalid>
Newsgroups: pl.comp.os.linux
Subject: Re: Problem z sed
Date: Tue, 8 Jun 2021 01:40:35 +0200
Organization: news.chmurka.net
Message-ID: <s9mapj$qnk$1$pk@news.chmurka.net>
References: <1fmviwwdpucgq$.m0xwrf6k91f6$.dlg@40tude.net> <s9ihqv$kf3$1$pk@news.chmurka.net> <s9jec8$42g$1$pk@news.chmurka.net> <slrnsbqggn.72r8.jaros@falcon.lasek.waw.pl>
NNTP-Posting-Host: apn-37-249-253-52.dynamic.gprs.plus.pl
Mime-Version: 1.0
Injection-Date: Mon, 7 Jun 2021 23:40:36 +0000 (UTC)
Injection-Info: news.chmurka.net; posting-account="pk"; posting-host="apn-37-249-253-52.dynamic.gprs.plus.pl:37.249.253.52"; logging-data="27380"; mail-complaints-to="abuse-news.(at).chmurka.net"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1
In-Reply-To: <slrnsbqggn.72r8.jaros@falcon.lasek.waw.pl>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit