Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

The Shuttle is now going five times the sound of speed. -- Dan Rather, first landing of Columbia


devel / comp.unix.shell / Re: Command 'strings' reading (not) standard input

SubjectAuthor
* Command 'strings' reading (not) standard inputChristian Weisgerber
`* Command 'strings' reading (not) standard inputKaz Kylheku
 `* Command 'strings' reading (not) standard inputChristian Weisgerber
  `* Command 'strings' reading (not) standard inputKaz Kylheku
   `* Command 'strings' reading (not) standard inputChristian Weisgerber
    `- Command 'strings' reading (not) standard inputKeith Thompson

1
Re: Command 'strings' reading (not) standard input

<slrntf5kne.2d72.naddy@lorvorc.mips.inka.de>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6602&group=comp.unix.shell#6602

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.szaf.org!inka.de!mips.inka.de!.POSTED.localhost!not-for-mail
From: naddy@mips.inka.de (Christian Weisgerber)
Newsgroups: comp.unix.shell
Subject: Re: Command 'strings' reading (not) standard input
Date: Tue, 9 Aug 2022 21:34:38 -0000 (UTC)
Message-ID: <slrntf5kne.2d72.naddy@lorvorc.mips.inka.de>
References: <tcu8re$1f6op$1@dont-email.me>
Injection-Date: Tue, 9 Aug 2022 21:34:38 -0000 (UTC)
Injection-Info: lorvorc.mips.inka.de; posting-host="localhost:::1";
logging-data="79075"; mail-complaints-to="usenet@mips.inka.de"
User-Agent: slrn/1.0.3 (FreeBSD)
 by: Christian Weisgerber - Tue, 9 Aug 2022 21:34 UTC

On 2022-08-09, Janis Papanagnou <janis_papanagnou@hotmail.com> wrote:

> Thanks to process substitution in newer shells I can write, e.g.,
> strings <( zcat file.gz ) | ...
>
> I am wondering, though, whether there's a reason why 'strings' is
> not defined to support (additionally) filter calling semantics
> ...(binary stream)... | strings | ...(text stream)...

There may have been an underlying rationale that executable format
parsing involves seeking rather than a linear read through the file.

For some historical perspective, I just looked at the 4.4BSD
strings(1) command: It tries to read the executable header and then
seek to the start of the text segment and only read the text and
data segments, although if it encounters an early error, it falls
back to simply reading everything.

--
Christian "naddy" Weisgerber naddy@mips.inka.de

Re: Command 'strings' reading (not) standard input

<20220809164847.568@kylheku.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6603&group=comp.unix.shell#6603

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: 480-992-1380@kylheku.com (Kaz Kylheku)
Newsgroups: comp.unix.shell
Subject: Re: Command 'strings' reading (not) standard input
Date: Tue, 9 Aug 2022 23:52:57 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 21
Message-ID: <20220809164847.568@kylheku.com>
References: <tcu8re$1f6op$1@dont-email.me>
<slrntf5kne.2d72.naddy@lorvorc.mips.inka.de>
Injection-Date: Tue, 9 Aug 2022 23:52:57 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="84e8273b583adad00ad7e57f17b66f69";
logging-data="1605204"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18+OjeCFTk4HEO8LfktzKBxHCG9AEo7lwM="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:NX6R4kjm3XPSpKr1MtakxXRfbMg=
 by: Kaz Kylheku - Tue, 9 Aug 2022 23:52 UTC

On 2022-08-09, Christian Weisgerber <naddy@mips.inka.de> wrote:
> On 2022-08-09, Janis Papanagnou <janis_papanagnou@hotmail.com> wrote:
>
>> Thanks to process substitution in newer shells I can write, e.g.,
>> strings <( zcat file.gz ) | ...
>>
>> I am wondering, though, whether there's a reason why 'strings' is
>> not defined to support (additionally) filter calling semantics
>> ...(binary stream)... | strings | ...(text stream)...
>
> There may have been an underlying rationale that executable format
> parsing involves seeking rather than a linear read through the file.

POSIX specifies -a which tells strings to scan the file in its entirety.
Otherwise what part of a file is scanned is implementation-defined.

GNU binutils strings makes that the default, probably because that's the
behavior you almost always want.

strings isn't just used for executables, but anything. Firmware flash
image files, PDFs, JPEGs.

Re: Command 'strings' reading (not) standard input

<slrntf7fmj.2uge.naddy@lorvorc.mips.inka.de>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6610&group=comp.unix.shell#6610

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.szaf.org!inka.de!mips.inka.de!.POSTED.localhost!not-for-mail
From: naddy@mips.inka.de (Christian Weisgerber)
Newsgroups: comp.unix.shell
Subject: Re: Command 'strings' reading (not) standard input
Date: Wed, 10 Aug 2022 14:21:07 -0000 (UTC)
Message-ID: <slrntf7fmj.2uge.naddy@lorvorc.mips.inka.de>
References: <tcu8re$1f6op$1@dont-email.me>
<slrntf5kne.2d72.naddy@lorvorc.mips.inka.de>
<20220809164847.568@kylheku.com>
Injection-Date: Wed, 10 Aug 2022 14:21:07 -0000 (UTC)
Injection-Info: lorvorc.mips.inka.de; posting-host="localhost:::1";
logging-data="96783"; mail-complaints-to="usenet@mips.inka.de"
User-Agent: slrn/1.0.3 (FreeBSD)
 by: Christian Weisgerber - Wed, 10 Aug 2022 14:21 UTC

On 2022-08-09, Kaz Kylheku <480-992-1380@kylheku.com> wrote:

> POSIX specifies -a which tells strings to scan the file in its entirety.
> Otherwise what part of a file is scanned is implementation-defined.
>
> GNU binutils strings makes that the default,

It does not. You can do what I just did and compare the respective
output.

> probably because that's the behavior you almost always want.

Running strings(1) on executables is a common usage, though. And
if the file isn't stripped, you generally don't want the strings
from the symbol table cluttering the output.

--
Christian "naddy" Weisgerber naddy@mips.inka.de

Re: Command 'strings' reading (not) standard input

<20220810183650.821@kylheku.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6616&group=comp.unix.shell#6616

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: 480-992-1380@kylheku.com (Kaz Kylheku)
Newsgroups: comp.unix.shell
Subject: Re: Command 'strings' reading (not) standard input
Date: Thu, 11 Aug 2022 01:39:55 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 24
Message-ID: <20220810183650.821@kylheku.com>
References: <tcu8re$1f6op$1@dont-email.me>
<slrntf5kne.2d72.naddy@lorvorc.mips.inka.de>
<20220809164847.568@kylheku.com>
<slrntf7fmj.2uge.naddy@lorvorc.mips.inka.de>
Injection-Date: Thu, 11 Aug 2022 01:39:55 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="b4d68a2f804d20e8bbb6fa2547a1300c";
logging-data="2088238"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/TB6DlaavwStbwpR4CYV2U78kXKOEqwRQ="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:9mAjvBmfXiUhlQFh73tKV8wHkl4=
 by: Kaz Kylheku - Thu, 11 Aug 2022 01:39 UTC

On 2022-08-10, Christian Weisgerber <naddy@mips.inka.de> wrote:
> On 2022-08-09, Kaz Kylheku <480-992-1380@kylheku.com> wrote:
>
>> POSIX specifies -a which tells strings to scan the file in its entirety.
>> Otherwise what part of a file is scanned is implementation-defined.
>>
>> GNU binutils strings makes that the default,
>
> It does not. You can do what I just did and compare the respective
> output.

Sorry, I should have clarified is that what what is default is the -a,
not what is described by my "Otherwise" sentence, and that I was going
by what is documented:

$ strings -h
Usage: strings [option(s)] [file(s)]
Display printable strings in [file(s)] (stdin by default)
The options are:
-a - --all Scan the entire file, not just the data section [default]

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal

Re: Command 'strings' reading (not) standard input

<slrntf9v3j.1e82.naddy@lorvorc.mips.inka.de>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6617&group=comp.unix.shell#6617

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!rocksolid2!i2pn.org!weretis.net!feeder8.news.weretis.net!news.szaf.org!inka.de!mips.inka.de!.POSTED.localhost!not-for-mail
From: naddy@mips.inka.de (Christian Weisgerber)
Newsgroups: comp.unix.shell
Subject: Re: Command 'strings' reading (not) standard input
Date: Thu, 11 Aug 2022 12:56:19 -0000 (UTC)
Message-ID: <slrntf9v3j.1e82.naddy@lorvorc.mips.inka.de>
References: <tcu8re$1f6op$1@dont-email.me>
<slrntf5kne.2d72.naddy@lorvorc.mips.inka.de>
<20220809164847.568@kylheku.com>
<slrntf7fmj.2uge.naddy@lorvorc.mips.inka.de>
<20220810183650.821@kylheku.com>
Injection-Date: Thu, 11 Aug 2022 12:56:19 -0000 (UTC)
Injection-Info: lorvorc.mips.inka.de; posting-host="localhost:::1";
logging-data="47363"; mail-complaints-to="usenet@mips.inka.de"
User-Agent: slrn/1.0.3 (FreeBSD)
 by: Christian Weisgerber - Thu, 11 Aug 2022 12:56 UTC

On 2022-08-11, Kaz Kylheku <480-992-1380@kylheku.com> wrote:

>>> GNU binutils strings makes that the default,
>
> Sorry, I should have clarified is that what what is default is the -a,

That's what I understood and disagreed with.

> $ strings -h
> Usage: strings [option(s)] [file(s)]
> Display printable strings in [file(s)] (stdin by default)
> The options are:
> -a - --all Scan the entire file, not just the data section [default]

So that default has changed, because...

$ strings /usr/bin/make |wc
1163 2871 20472
$ strings -a /usr/bin/make |wc
1188 2896 20698
$ strings --version
GNU strings (GNU Binutils for Debian) 2.22
Copyright 2011 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) any later version.
This program has absolutely no warranty.

--
Christian "naddy" Weisgerber naddy@mips.inka.de

Re: Command 'strings' reading (not) standard input

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

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6618&group=comp.unix.shell#6618

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: Keith.S.Thompson+u@gmail.com (Keith Thompson)
Newsgroups: comp.unix.shell
Subject: Re: Command 'strings' reading (not) standard input
Date: Thu, 11 Aug 2022 12:22:52 -0700
Organization: None to speak of
Lines: 41
Message-ID: <87a68apotv.fsf@nosuchdomain.example.com>
References: <tcu8re$1f6op$1@dont-email.me>
<slrntf5kne.2d72.naddy@lorvorc.mips.inka.de>
<20220809164847.568@kylheku.com>
<slrntf7fmj.2uge.naddy@lorvorc.mips.inka.de>
<20220810183650.821@kylheku.com>
<slrntf9v3j.1e82.naddy@lorvorc.mips.inka.de>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: reader01.eternal-september.org; posting-host="e242dc6cf796207e82352a04d0780303";
logging-data="2372710"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX197UtJ8xSddzmMwFVmfK13m"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:Mj9dpFFOpxn+pcoUsgfpLErXvS4=
sha1:wXMmAk1xnHgxy3gI8YWcbSjtS1M=
 by: Keith Thompson - Thu, 11 Aug 2022 19:22 UTC

Christian Weisgerber <naddy@mips.inka.de> writes:
> On 2022-08-11, Kaz Kylheku <480-992-1380@kylheku.com> wrote:
>>>> GNU binutils strings makes that the default,
>>
>> Sorry, I should have clarified is that what what is default is the -a,
>
> That's what I understood and disagreed with.
>
>> $ strings -h
>> Usage: strings [option(s)] [file(s)]
>> Display printable strings in [file(s)] (stdin by default)
>> The options are:
>> -a - --all Scan the entire file, not just the data section [default]
>
> So that default has changed, because...
>
> $ strings /usr/bin/make |wc
> 1163 2871 20472
> $ strings -a /usr/bin/make |wc
> 1188 2896 20698
> $ strings --version
> GNU strings (GNU Binutils for Debian) 2.22
> Copyright 2011 Free Software Foundation, Inc.
> This program is free software; you may redistribute it under the terms of
> the GNU General Public License version 3 or (at your option) any later version.
> This program has absolutely no warranty.

GNU binutils can be configured at build time to default either to
"-a/--all" (scan the entire file) or "-d/--data" (only scan the
data sections). Different distributions (Debian et al) might
configure it differently. The usage message changes depending
on how it's configured. (See DEFAULT_STRINGS_ALL in the binutils
sources if you're interested in the details.)

Regardless of that configuration, it will scan the entire file if
it doesn't recognize the file type or if it's reading from stdin.

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for Philips
void Void(void) { Void(); } /* The recursive call of the void */

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor