Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

* dpkg ponders: 'C++' should have been called 'D' -- #Debian


devel / comp.unix.shell / Re: how to capture only 7 or 8 in /etc/redhat-release

SubjectAuthor
* Re: how to capture only 7 or 8 in /etc/redhat-releaseChris Elvidge
+* Re: how to capture only 7 or 8 in /etc/redhat-releaseNeeraj Kumar
|+* Re: how to capture only 7 or 8 in /etc/redhat-releaseJanis Papanagnou
||`- Re: how to capture only 7 or 8 in /etc/redhat-releaseJanis Papanagnou
|`* Re: how to capture only 7 or 8 in /etc/redhat-releaseKaz Kylheku
| `* Re: how to capture only 7 or 8 in /etc/redhat-releaseKeith Thompson
|  `* Re: how to capture only 7 or 8 in /etc/redhat-releaseKaz Kylheku
|   `- Re: how to capture only 7 or 8 in /etc/redhat-releaseKeith Thompson
`- Re: how to capture only 7 or 8 in /etc/redhat-releaseBen Bacarisse

1
Re: how to capture only 7 or 8 in /etc/redhat-release

<u5kljo$bev4$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6310&group=comp.unix.shell#6310

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: chr...@mshome.net (Chris Elvidge)
Newsgroups: comp.unix.shell
Subject: Re: how to capture only 7 or 8 in /etc/redhat-release
Date: Mon, 5 Jun 2023 13:48:56 +0100
Organization: A noiseless patient Spider
Lines: 9
Message-ID: <u5kljo$bev4$1@dont-email.me>
References: <c617ead2-f74c-442a-a072-2e5d620ad183n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 5 Jun 2023 12:48:56 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="875372d7c2cf77126178eee13efc3871";
logging-data="375780"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+P2Uijq6r3O2SHb1mUvUj9F5J8RJrFYNk="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
Thunderbird/52.2.1 Lightning/5.4
Cancel-Lock: sha1:xg3EetrR5QlgylcnXpKB1E0qIfc=
In-Reply-To: <c617ead2-f74c-442a-a072-2e5d620ad183n@googlegroups.com>
Content-Language: en-GB
 by: Chris Elvidge - Mon, 5 Jun 2023 12:48 UTC

On 05/06/2023 13:23, Neeraj Kumar wrote:
> I have two version; please help me to get the version in the form of 7 or 8
>

grep -o -E "7|8" /etc/redhat-release

--
Chris Elvidge
England

Re: how to capture only 7 or 8 in /etc/redhat-release

<6f741ffe-a93f-45d1-8bdb-2dff82a50f9cn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6311&group=comp.unix.shell#6311

  copy link   Newsgroups: comp.unix.shell
X-Received: by 2002:a05:620a:2985:b0:75c:b4b2:1fa9 with SMTP id r5-20020a05620a298500b0075cb4b21fa9mr5012144qkp.2.1685970848675;
Mon, 05 Jun 2023 06:14:08 -0700 (PDT)
X-Received: by 2002:a05:6870:4296:b0:19f:2d28:9051 with SMTP id
y22-20020a056870429600b0019f2d289051mr1629623oah.1.1685970848262; Mon, 05 Jun
2023 06:14:08 -0700 (PDT)
Path: i2pn2.org!i2pn.org!news.niel.me!glou.org!news.glou.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.unix.shell
Date: Mon, 5 Jun 2023 06:14:07 -0700 (PDT)
In-Reply-To: <u5kljo$bev4$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=49.205.228.234; posting-account=4pLswAoAAABk7Ww6WH1js7Ke8hPdLuHX
NNTP-Posting-Host: 49.205.228.234
References: <c617ead2-f74c-442a-a072-2e5d620ad183n@googlegroups.com> <u5kljo$bev4$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <6f741ffe-a93f-45d1-8bdb-2dff82a50f9cn@googlegroups.com>
Subject: Re: how to capture only 7 or 8 in /etc/redhat-release
From: neeraj.f...@gmail.com (Neeraj Kumar)
Injection-Date: Mon, 05 Jun 2023 13:14:08 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Neeraj Kumar - Mon, 5 Jun 2023 13:14 UTC

On Monday, June 5, 2023 at 6:19:02 PM UTC+5:30, Chris Elvidge wrote:
> On 05/06/2023 13:23, Neeraj Kumar wrote:
> > I have two version; please help me to get the version in the form of 7 or 8
> >
> grep -o -E "7|8" /etc/redhat-release
>
> --
> Chris Elvidge
> England

Thank you for the reply..
if the Linux is 8.7 then it will not give proper output.

can we have this by awk command .. I tried multiple but unlucky to get in single line

Re: how to capture only 7 or 8 in /etc/redhat-release

<87h6rmt4is.fsf@bsb.me.uk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6312&group=comp.unix.shell#6312

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ben.use...@bsb.me.uk (Ben Bacarisse)
Newsgroups: comp.unix.shell
Subject: Re: how to capture only 7 or 8 in /etc/redhat-release
Date: Mon, 05 Jun 2023 14:36:27 +0100
Organization: A noiseless patient Spider
Lines: 23
Message-ID: <87h6rmt4is.fsf@bsb.me.uk>
References: <c617ead2-f74c-442a-a072-2e5d620ad183n@googlegroups.com>
<u5kljo$bev4$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="833c61215d84b6eb9c8495b148ad4060";
logging-data="384504"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+SYUP9JxjZWW1+oLM6uUhqdxanoQfbERk="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
Cancel-Lock: sha1:gVuu3sn/Y6lhQ0qXIPwCjhH3sXE=
sha1:efBDMuRKeT0S1qo+O/7vzQpcKlg=
X-BSB-Auth: 1.dbfee82c0edf7ed8f024.20230605143627BST.87h6rmt4is.fsf@bsb.me.uk
 by: Ben Bacarisse - Mon, 5 Jun 2023 13:36 UTC

Chris Elvidge <chris@mshome.net> writes:

> On 05/06/2023 13:23, Neeraj Kumar wrote:
>> I have two version; please help me to get the version in the form of 7 or 8
>>
>
> grep -o -E "7|8" /etc/redhat-release

This will say 7 for release 6.7 (not that I know there ever was such a
release number) but even given the OPs restriction to 7 or 8, version
7.8 will give two lines.

One way (if one's grep has them) would be to use Perl REs and employ a
"lookbehind" assertion:

grep -o -P '(?<=release )\d+' /etc/redhat-release

but then it's not at all clear what OP really wants.

To the OP: it's generally better to look in /etc/os-release.

--
Ben.

Re: how to capture only 7 or 8 in /etc/redhat-release

<u5kpgv$bqka$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6313&group=comp.unix.shell#6313

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: janis_pa...@hotmail.com (Janis Papanagnou)
Newsgroups: comp.unix.shell
Subject: Re: how to capture only 7 or 8 in /etc/redhat-release
Date: Mon, 5 Jun 2023 15:55:43 +0200
Organization: A noiseless patient Spider
Lines: 37
Message-ID: <u5kpgv$bqka$1@dont-email.me>
References: <c617ead2-f74c-442a-a072-2e5d620ad183n@googlegroups.com>
<u5kljo$bev4$1@dont-email.me>
<6f741ffe-a93f-45d1-8bdb-2dff82a50f9cn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 5 Jun 2023 13:55:43 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="96fccb7473ad9d1a0a0b766716891ac8";
logging-data="387722"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18KKPQ2UiXNNe1K88X14JV9"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:DjYWbLegWvuVIAQD6oMskeUePWM=
In-Reply-To: <6f741ffe-a93f-45d1-8bdb-2dff82a50f9cn@googlegroups.com>
X-Enigmail-Draft-Status: N1110
 by: Janis Papanagnou - Mon, 5 Jun 2023 13:55 UTC

On 05.06.2023 15:14, Neeraj Kumar wrote:
> On Monday, June 5, 2023 at 6:19:02 PM UTC+5:30, Chris Elvidge wrote:
>> On 05/06/2023 13:23, Neeraj Kumar wrote:
>>> I have two version; please help me to get the version in the form of 7 or 8
>>>
>> grep -o -E "7|8" /etc/redhat-release
>>
>> --
>> Chris Elvidge
>> England
>
> Thank you for the reply..
> if the Linux is 8.7 then it will not give proper output.

You could use sed for the extraction of the number

echo " 8.7 "| sed 's/.*\([78]\)[.].*/\1/'

or shell's expr

expr " 8.7 " : '.*\([78]\)[.].*'

(In both cases taking the digit 7 or 8 in front of a literal dot.)

>
> can we have this by awk command .. I tried multiple but unlucky to get in single line

Why awk?

With Ben's suggestion for the source of the version information

awk -F[=\".] '/VERSION=/{print $3}' /etc/os-release

(can of course also done with sed or shell in a most simple way).

Janis

Re: how to capture only 7 or 8 in /etc/redhat-release

<u5kpk4$bqka$2@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6314&group=comp.unix.shell#6314

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: janis_pa...@hotmail.com (Janis Papanagnou)
Newsgroups: comp.unix.shell
Subject: Re: how to capture only 7 or 8 in /etc/redhat-release
Date: Mon, 5 Jun 2023 15:57:24 +0200
Organization: A noiseless patient Spider
Lines: 8
Message-ID: <u5kpk4$bqka$2@dont-email.me>
References: <c617ead2-f74c-442a-a072-2e5d620ad183n@googlegroups.com>
<u5kljo$bev4$1@dont-email.me>
<6f741ffe-a93f-45d1-8bdb-2dff82a50f9cn@googlegroups.com>
<u5kpgv$bqka$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 5 Jun 2023 13:57:24 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="96fccb7473ad9d1a0a0b766716891ac8";
logging-data="387722"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19qMH163UhnI0TIQ5jvu4uc"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:ze3n8v37frFl6iEUSdav6fUhgqo=
In-Reply-To: <u5kpgv$bqka$1@dont-email.me>
 by: Janis Papanagnou - Mon, 5 Jun 2023 13:57 UTC

On 05.06.2023 15:55, Janis Papanagnou wrote:
>
> or shell's expr

Erm.. - it's not a shell built-in but an ordinary command.

Janis

Re: how to capture only 7 or 8 in /etc/redhat-release

<20230605092702.761@kylheku.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6316&group=comp.unix.shell#6316

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 864-117-...@kylheku.com (Kaz Kylheku)
Newsgroups: comp.unix.shell
Subject: Re: how to capture only 7 or 8 in /etc/redhat-release
Date: Mon, 5 Jun 2023 16:29:10 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 24
Message-ID: <20230605092702.761@kylheku.com>
References: <c617ead2-f74c-442a-a072-2e5d620ad183n@googlegroups.com>
<u5kljo$bev4$1@dont-email.me>
<6f741ffe-a93f-45d1-8bdb-2dff82a50f9cn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 5 Jun 2023 16:29:10 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="c421a6e26b3a98d370871b3f12904d23";
logging-data="416227"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/NIfl1Aut2wng27WWLhAQF4Hv8/5tVpnY="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:+3MV80xiXwTtuD/QywIbCG8RinI=
 by: Kaz Kylheku - Mon, 5 Jun 2023 16:29 UTC

On 2023-06-05, Neeraj Kumar <neeraj.friendslover@gmail.com> wrote:
> On Monday, June 5, 2023 at 6:19:02 PM UTC+5:30, Chris Elvidge wrote:
>> On 05/06/2023 13:23, Neeraj Kumar wrote:
>> > I have two version; please help me to get the version in the form of 7 or 8
>> >
>> grep -o -E "7|8" /etc/redhat-release
>>
>> --
>> Chris Elvidge
>> England
>
> Thank you for the reply..
> if the Linux is 8.7 then it will not give proper output.

If Linux is 8.7, today can't be 2023. The current stable version is
6.3.6, with a 6.4-rc5 (release candidate 5) on the mainline.

See https://kernel.org

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca

Re: how to capture only 7 or 8 in /etc/redhat-release

<873535ke5o.fsf@nosuchdomain.example.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6319&group=comp.unix.shell#6319

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.unix.shell
Subject: Re: how to capture only 7 or 8 in /etc/redhat-release
Date: Mon, 05 Jun 2023 10:33:07 -0700
Organization: None to speak of
Lines: 18
Message-ID: <873535ke5o.fsf@nosuchdomain.example.com>
References: <c617ead2-f74c-442a-a072-2e5d620ad183n@googlegroups.com>
<u5kljo$bev4$1@dont-email.me>
<6f741ffe-a93f-45d1-8bdb-2dff82a50f9cn@googlegroups.com>
<20230605092702.761@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="f8790b9e901dd4e2d6ca565a2740b51b";
logging-data="430349"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18feR4y7KpKAx2l4j9MaLR0"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:aiRz03Dw33H0459sqomKiw8cwyM=
sha1:JOT45u9qcpShpc20W0e4ewDGwqI=
 by: Keith Thompson - Mon, 5 Jun 2023 17:33 UTC

Kaz Kylheku <864-117-4973@kylheku.com> writes:
> On 2023-06-05, Neeraj Kumar <neeraj.friendslover@gmail.com> wrote:
[...]
>> if the Linux is 8.7 then it will not give proper output.
>
> If Linux is 8.7, today can't be 2023. The current stable version is
> 6.3.6, with a 6.4-rc5 (release candidate 5) on the mainline.
>
> See https://kernel.org

Kaz's point is that Linux (the kernel) and Red Hat (the operating
system) are two different things with different version numbers.
/etc/redhat-release has information about the OS.

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Will write code for food.
void Void(void) { Void(); } /* The recursive call of the void */

Re: how to capture only 7 or 8 in /etc/redhat-release

<20230605115454.560@kylheku.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6320&group=comp.unix.shell#6320

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 864-117-...@kylheku.com (Kaz Kylheku)
Newsgroups: comp.unix.shell
Subject: Re: how to capture only 7 or 8 in /etc/redhat-release
Date: Mon, 5 Jun 2023 18:56:43 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 24
Message-ID: <20230605115454.560@kylheku.com>
References: <c617ead2-f74c-442a-a072-2e5d620ad183n@googlegroups.com>
<u5kljo$bev4$1@dont-email.me>
<6f741ffe-a93f-45d1-8bdb-2dff82a50f9cn@googlegroups.com>
<20230605092702.761@kylheku.com> <873535ke5o.fsf@nosuchdomain.example.com>
Injection-Date: Mon, 5 Jun 2023 18:56:43 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="c421a6e26b3a98d370871b3f12904d23";
logging-data="451260"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19yjvefHc5qdgHNQyUwhI3t8hWlEj6hy8U="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:KcsdrfXWJlo9Hoass4b2brIPXqM=
 by: Kaz Kylheku - Mon, 5 Jun 2023 18:56 UTC

On 2023-06-05, Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
> Kaz Kylheku <864-117-4973@kylheku.com> writes:
>> On 2023-06-05, Neeraj Kumar <neeraj.friendslover@gmail.com> wrote:
> [...]
>>> if the Linux is 8.7 then it will not give proper output.
>>
>> If Linux is 8.7, today can't be 2023. The current stable version is
>> 6.3.6, with a 6.4-rc5 (release candidate 5) on the mainline.
>>
>> See https://kernel.org
>
> Kaz's point is that Linux (the kernel) and Red Hat (the operating
> system) are two different things with different version numbers.
> /etc/redhat-release has information about the OS.

Unlike some, I don't have a problem with Red Hat being called a
"Linux distribution", but when you start talking about it it being
Linux 8.7, we have crossed the blurry line between political
and stupid.

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca

Re: how to capture only 7 or 8 in /etc/redhat-release

<87y1kxis11.fsf@nosuchdomain.example.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6321&group=comp.unix.shell#6321

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.unix.shell
Subject: Re: how to capture only 7 or 8 in /etc/redhat-release
Date: Mon, 05 Jun 2023 13:16:26 -0700
Organization: None to speak of
Lines: 31
Message-ID: <87y1kxis11.fsf@nosuchdomain.example.com>
References: <c617ead2-f74c-442a-a072-2e5d620ad183n@googlegroups.com>
<u5kljo$bev4$1@dont-email.me>
<6f741ffe-a93f-45d1-8bdb-2dff82a50f9cn@googlegroups.com>
<20230605092702.761@kylheku.com>
<873535ke5o.fsf@nosuchdomain.example.com>
<20230605115454.560@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="f8790b9e901dd4e2d6ca565a2740b51b";
logging-data="471016"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/shIqY3vHe8+6cXWOiB09y"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:C1f0AiY6sC7PMfzgrGzaSYRPGvA=
sha1:sY5+lPdt/aMO/XR0SMoQITi09N4=
 by: Keith Thompson - Mon, 5 Jun 2023 20:16 UTC

Kaz Kylheku <864-117-4973@kylheku.com> writes:
> On 2023-06-05, Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
>> Kaz Kylheku <864-117-4973@kylheku.com> writes:
>>> On 2023-06-05, Neeraj Kumar <neeraj.friendslover@gmail.com> wrote:
>> [...]
>>>> if the Linux is 8.7 then it will not give proper output.
>>>
>>> If Linux is 8.7, today can't be 2023. The current stable version is
>>> 6.3.6, with a 6.4-rc5 (release candidate 5) on the mainline.
>>>
>>> See https://kernel.org
>>
>> Kaz's point is that Linux (the kernel) and Red Hat (the operating
>> system) are two different things with different version numbers.
>> /etc/redhat-release has information about the OS.
>
> Unlike some, I don't have a problem with Red Hat being called a
> "Linux distribution", but when you start talking about it it being
> Linux 8.7, we have crossed the blurry line between political
> and stupid.

My point was not about the politics of referring to a distribution as
"Linux". My point was that the person you were addressing might not
have understood what you were talking about.

Neeraj wrote something incorrect. That doesn't imply they're stupid.

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Will write code for food.
void Void(void) { Void(); } /* The recursive call of the void */

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor