Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

A Linux machine! because a 486 is a terrible thing to waste! (By jjs@wintermute.ucr.edu, Joe Sloan)


computers / alt.comp.os.windows-10 / line count

SubjectAuthor
* line countScott Lurndal
+* Re: line countAndy Burns
|`- Re: line countPaul
+- Re: line countVanguardLH
`* Re: line countmechanic
 `- Re: line countZaidy036

1
line count

<sifl7n$5qj$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=55914&group=alt.comp.os.windows-10#55914

  copy link   Newsgroups: alt.comp.os.windows-10
Path: i2pn2.org!i2pn.org!aioe.org!byfYGra9UYTu3eUW2DIdpA.user.46.165.242.75.POSTED!not-for-mail
From: scott@slp53.sl.home (Scott Lurndal)
Newsgroups: alt.comp.os.windows-10
Subject: line count
Date: Wed, 22 Sep 2021 19:22:22 +0300
Organization: UsenetServer - www.usenetserver.com
Message-ID: <sifl7n$5qj$1@gioia.aioe.org>
Reply-To: slp53@pacbell.net
Injection-Info: gioia.aioe.org; logging-data="5971"; posting-host="byfYGra9UYTu3eUW2DIdpA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-newsreader: xrn 9.03-beta-14-64bit
X-Notice: Filtered by postfilter v. 0.9.2
 by: Scott Lurndal - Wed, 22 Sep 2021 16:22 UTC

How does Windows command line do a line count?

I am using adb to connect to Android to pop up some menus and I needed to
check my installed packages where I just wanted to run a line count.

This for example lists all the installed packages
C:\> adb shell pm list packages
And this lists packages with "google" in the name
C:\> adb shell pm list packages google
But more to the need, this lists the system packages
C:\> adb shell pm list packages -s
And this lists the added 3rd party packages
C:\> adb shell pm list packages -3

What's a good way to add a line count to that command?

Re: line count

<ir1425F9mquU1@mid.individual.net>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=55916&group=alt.comp.os.windows-10#55916

  copy link   Newsgroups: alt.comp.os.windows-10
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!lilly.ping.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: usenet@andyburns.uk (Andy Burns)
Newsgroups: alt.comp.os.windows-10
Subject: Re: line count
Date: Wed, 22 Sep 2021 17:30:37 +0100
Lines: 13
Message-ID: <ir1425F9mquU1@mid.individual.net>
References: <sifl7n$5qj$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net h9TNcA7PXtkf5+hmoNlw9ggrz+y+02kFNXyzZnBG69fIRF7BEC
Cancel-Lock: sha1:2jmlfOei9kk3oAZDNceas7vcvLc=
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.1.1
Content-Language: en-GB
In-Reply-To: <sifl7n$5qj$1@gioia.aioe.org>
 by: Andy Burns - Wed, 22 Sep 2021 16:30 UTC

Scott Lurndal wrote:

> How does Windows command line do a line count?
> this lists packages with "google" in the name
> C:\> adb shell pm list packages google
>
> What's a good way to add a line count to that command?

like "wc -l" you mean?

count all non-empty lines, perhaps?

adb shell pm list packages google | find /c /v ""

Re: line count

<pdj20zj72wjw$.dlg@v.nguard.lh>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=55924&group=alt.comp.os.windows-10#55924

  copy link   Newsgroups: alt.comp.os.windows-10
Path: i2pn2.org!i2pn.org!aioe.org!news.mb-net.net!open-news-network.org!news.fh-stralsund.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: V@nguard.LH (VanguardLH)
Newsgroups: alt.comp.os.windows-10
Subject: Re: line count
Date: Wed, 22 Sep 2021 14:35:29 -0500
Organization: Usenet Elder
Lines: 55
Message-ID: <pdj20zj72wjw$.dlg@v.nguard.lh>
References: <sifl7n$5qj$1@gioia.aioe.org>
Reply-To: invalid@invalid.invalid
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Trace: individual.net po0f/hIqAtWVpe0ttKSZrAskVWdostbcRnmq8e17JN1bxvc6X4
Keywords: VanguardLH VLH811
Cancel-Lock: sha1:m7dpSD5VlpYQkW8zVTyz/F0hQeo=
User-Agent: 40tude_Dialog/2.0.15.41
 by: VanguardLH - Wed, 22 Sep 2021 19:35 UTC

Scott Lurndal <scott@slp53.sl.home> wrote:

> How does Windows command line do a line count?
>
> I am using adb to connect to Android to pop up some menus and I needed to
> check my installed packages where I just wanted to run a line count.
>
> This for example lists all the installed packages
> C:\> adb shell pm list packages
> And this lists packages with "google" in the name
> C:\> adb shell pm list packages google
> But more to the need, this lists the system packages
> C:\> adb shell pm list packages -s
> And this lists the added 3rd party packages
> C:\> adb shell pm list packages -3
>
> What's a good way to add a line count to that command?

Just guessing here, but I'll assume 'adb' is a console-mode program;
that is, you run it inside a command shell on the PC, and adb's output
is to the stdout stream. Wouldn't it be easier to read the stdout from
'adb' by piping it into, say, Notepad.

adb shell pm list packages > %temp%\list.txt & notepad %temp%\list.txt

Where you save stdout into a file (read by Notepad) is your choice.
Since I use CCleaner manually, and have it scheduled to run at night, I
dump such temp files into the %temp% folder which gets periodically
cleaned out. I tried the following to delete the temp file after
viewing it:

adb shell pm list packages > %temp%\list.txt & notepad %temp%\list.txt & del %temp%\list.txt

but it fails with Notepad not finding the file. That's because chaining
continues the instant status is return by a program. Notepad
immediately returns status, so the 'del' command executes before Notepad
gets around to loading the file. & is used to chain command together on
the same command line. && does the same thing, except the following
chain only executes if status is zero (all others are error statuses);
however, Notepad immediately returns zero status, so not even && will
pause the chain. You could use:

dir > %temp%\list.txt & notepad %temp%\list.txt & pause & del %temp%\list.txt

but then you have to return to the command shell to hit a key to
continue the chain after the pause.

Note the above is just to show how to pipe stdout to a file, and read
the captured data stream saved into a file in some program. Notepad
does not show line numbers, but Notepad++ does, as well as other
editors.

You would have an easier read, better navigation within the output, find
[and replace] and other features in a GUI editor than dealing with
stdout in a command shell.

Re: line count

<sig9qa$s8i$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=55926&group=alt.comp.os.windows-10#55926

  copy link   Newsgroups: alt.comp.os.windows-10
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: nospam@needed.invalid (Paul)
Newsgroups: alt.comp.os.windows-10
Subject: Re: line count
Date: Wed, 22 Sep 2021 18:13:31 -0400
Organization: A noiseless patient Spider
Lines: 66
Message-ID: <sig9qa$s8i$1@dont-email.me>
References: <sifl7n$5qj$1@gioia.aioe.org> <ir1425F9mquU1@mid.individual.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 22 Sep 2021 22:13:30 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="671b79fc4154d4a5669355465aa0d8b7";
logging-data="28946"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Fsvk5O9Sq3w/NekrvwU2N7pGloPH2BxI="
User-Agent: Ratcatcher/2.0.0.25 (Windows/20130802)
Cancel-Lock: sha1:/mt/56lCKabCwMzKnOaWoaGvQC8=
In-Reply-To: <ir1425F9mquU1@mid.individual.net>
 by: Paul - Wed, 22 Sep 2021 22:13 UTC

Andy Burns wrote:
> Scott Lurndal wrote:
>
>> How does Windows command line do a line count?
>> this lists packages with "google" in the name
>> C:\> adb shell pm list packages google
>>
>> What's a good way to add a line count to that command?
>
> like "wc -l" you mean?
>
> count all non-empty lines, perhaps?
>
> adb shell pm list packages google | find /c /v ""

The subsystem for Linux provides Windows users with
access to ELF executables, for fun and profit.

Here, we use Word Count from Linux, and the "count lines" option.

adb shell pm list packages google | wsl wc -l

This requires Programs and Features : Windows Features
then "Windows Subsystem for Linux". Followed by
a trip to the Windows Store and selecting Ubuntu 20.04
in there. Or alternately

wsl --help # Will only work if optional
# subsystem installed first
wsl --list --online # list available distros
wsl --status # list your current distros (could be "None")
wsl --install -d Ubuntu-20.04 # Install a specific distro. Will ask for
# account name like "bullwinkle" and a password
# so you can use the sudo command in Ubuntu

Once a distro is installed, and your --status is
looking good, you can try some shell stuff

bash # interactive shell, pure unix commands, ELF progs
wsl ls | wsl wc -l # start two temp subshells, pipe to stdout
# Could even script this, haven't tested...

wsl ls /mnt/c/users/scott # "So what is in my homedir exactly"
# Drives are under /mnt, there is no /dev available

Note: Not everyone is all that interested in this "topic",
and thus the above is not "promotional quality instruction".

The recipe changes a bit from release to release. The
current WSL2 implementation uses a real Linux kernel, likely
in some sort of container strategy. This is why the machine
must have virtualization features like VT-x and friends, and
the subsystem won't install unless it sniffs some sort of
hardware for the job.

May cause hairloss (I've lost a few strands on occasion
because of this subsystem). But if you're goofing around,
why not.

I would have answered with gnuwin32 coreutils, but that is
apparently not running here in Win10. Which is a first.
There is also Cygwin, mentioned so no one forgets.
Cygwin is definitely workable, but... more hairloss because
of where the support does or doesn't come from.

Paul

Re: line count

<1payacltx1bxa$.dlg@example1357.net>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=55956&group=alt.comp.os.windows-10#55956

  copy link   Newsgroups: alt.comp.os.windows-10
Path: i2pn2.org!i2pn.org!aioe.org!pvFLbECeD+WylsByNUsQgQ.user.46.165.242.91.POSTED!not-for-mail
From: mechanic@example.net (mechanic)
Newsgroups: alt.comp.os.windows-10
Subject: Re: line count
Date: Thu, 23 Sep 2021 14:24:07 +0100
Organization: Aioe.org NNTP Server
Message-ID: <1payacltx1bxa$.dlg@example1357.net>
References: <sifl7n$5qj$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="43806"; posting-host="pvFLbECeD+WylsByNUsQgQ.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: 40tude_Dialog/2.0.15.1
X-Notice: Filtered by postfilter v. 0.9.2
 by: mechanic - Thu, 23 Sep 2021 13:24 UTC

On Wed, 22 Sep 2021 19:22:22 +0300, Scott Lurndal wrote:

> How does Windows command line do a line count?
>
> I am using adb to connect to Android to pop up some menus and I needed to
> check my installed packages where I just wanted to run a line count.
>
> This for example lists all the installed packages
> C:\> adb shell pm list packages
> And this lists packages with "google" in the name
> C:\> adb shell pm list packages google
> But more to the need, this lists the system packages
> C:\> adb shell pm list packages -s
> And this lists the added 3rd party packages
> C:\> adb shell pm list packages -3
>
> What's a good way to add a line count to that command?

These are text files? Not much point in counting lines otherwise.

Re: line count

<sii4jp$k0q$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=55964&group=alt.comp.os.windows-10#55964

  copy link   Newsgroups: alt.comp.os.windows-10
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: Zaidy036@air.isp.spam (Zaidy036)
Newsgroups: alt.comp.os.windows-10
Subject: Re: line count
Date: Thu, 23 Sep 2021 10:56:58 -0400
Organization: A noiseless patient Spider
Lines: 25
Message-ID: <sii4jp$k0q$1@dont-email.me>
References: <sifl7n$5qj$1@gioia.aioe.org> <1payacltx1bxa$.dlg@example1357.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 23 Sep 2021 14:56:57 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="f54f221d548205d7a17d48e720c3fafc";
logging-data="20506"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+UZ8i+Q7oca2Garr95j8vAuNhrEX7RjOo="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.8.1
Cancel-Lock: sha1:WDah8NZdrkG7KH9JXJNw3witDSk=
In-Reply-To: <1payacltx1bxa$.dlg@example1357.net>
Content-Language: en-US
 by: Zaidy036 - Thu, 23 Sep 2021 14:56 UTC

On 9/23/2021 9:24 AM, mechanic wrote:
> On Wed, 22 Sep 2021 19:22:22 +0300, Scott Lurndal wrote:
>
>> How does Windows command line do a line count?
>>
>> I am using adb to connect to Android to pop up some menus and I needed to
>> check my installed packages where I just wanted to run a line count.
>>
>> This for example lists all the installed packages
>> C:\> adb shell pm list packages
>> And this lists packages with "google" in the name
>> C:\> adb shell pm list packages google
>> But more to the need, this lists the system packages
>> C:\> adb shell pm list packages -s
>> And this lists the added 3rd party packages
>> C:\> adb shell pm list packages -3
>>
>> What's a good way to add a line count to that command?
>
> These are text files? Not much point in counting lines otherwise.
>
would a batch do the job?
save the file into a windows file.txt and then make a loop to count the
code for "new line". If cannot be done replace all new line codes with
some single unused value and count those.


computers / alt.comp.os.windows-10 / line count

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor