Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > alt.comp.os.windows-10 > #195241 > unrolled thread
| Started by | Maria Sophia <mariasophia@comprehension.com> |
|---|---|
| First post | 2026-08-26 20:08 -0600 |
| Last post | 2026-08-30 20:19 -0600 |
| Articles | 20 on this page of 106 — 17 participants |
Back to article view | Back to alt.comp.os.windows-10
PSA: How to add WSL grep to the Windwos command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-26 20:08 -0600
Re: PSA: How to add WSL grep to the Windwos command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-27 00:05 -0600
Re: PSA: How to add WSL grep to the Windwos command-line PATH Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-27 07:13 +0000
Re: PSA: How to add WSL grep to the Windwos command-line PATH "R.Wieser" <address@is.invalid> - 2026-08-27 10:02 +0200
Re: PSA: How to add WSL grep to the Windwos command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-27 12:14 -0600
Re: PSA: How to add WSL grep to the Windwos command-line PATH "R.Wieser" <address@is.invalid> - 2026-08-27 22:06 +0200
Re: PSA: How to add WSL grep to the Windwos command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-27 20:39 -0600
Re: PSA: How to add WSL grep to the Windwos command-line PATH "R.Wieser" <address@is.invalid> - 2026-08-28 14:35 +0200
Re: PSA: How to add WSL grep to the Windwos command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-28 14:47 -0600
Re: PSA: How to add WSL grep to the Windwos command-line PATH Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-27 20:19 +0000
Re: PSA: How to add WSL grep to the Windwos command-line PATH "Carlos E. R." <robin_listas@es.invalid> - 2026-08-27 22:31 +0200
Re: PSA: How to add WSL grep to the Windwos command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-27 20:33 -0600
Re: PSA: How to add WSL grep to the Windwos command-line PATH Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-28 04:59 +0000
Re: PSA: How to add WSL grep to the Windwos command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-30 21:03 -0600
Re: PSA: How to add WSL grep to the Windwos command-line PATH Frank Slootweg <this@ddress.is.invalid> - 2026-08-27 10:22 +0000
Re: PSA: How to add WSL grep to the Windwos command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-27 11:36 -0600
Re: PSA: How to add WSL grep to the Windwos command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-27 12:39 -0600
Re: PSA: How to add WSL grep to the Windwos command-line PATH "Carlos E. R." <robin_listas@es.invalid> - 2026-08-27 22:20 +0200
Re: PSA: How to add WSL grep to the Windwos command-line PATH Frank Slootweg <this@ddress.is.invalid> - 2026-08-28 18:07 +0000
Re: PSA: How to add WSL grep to the Windwos command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-28 14:49 -0600
Re: PSA: How to add WSL grep to the Windwos command-line PATH Frank Slootweg <this@ddress.is.invalid> - 2026-08-27 19:11 +0000
Re: PSA: How to add WSL grep to the Windwos command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-27 13:21 -0600
Re: PSA: How to add WSL grep to the Windwos command-line PATH vallor <vallor@vallor.earth> - 2026-08-27 19:59 +0000
Re: PSA: How to add WSL grep to the Windwos command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-27 21:11 -0600
Re: PSA: How to add WSL grep to the Windows command-line PATH Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-28 05:00 +0000
Re: PSA: How to add WSL grep to the Windows command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-28 15:27 -0600
Re: PSA: How to add WSL grep to the Windows command-line PATH Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-28 22:26 +0000
Re: PSA: How to add WSL grep to the Windows command-line PATH Hank Rogers <Hank@nospam.invalid> - 2026-08-28 17:47 -0500
Re: PSA: How to add WSL grep to the Windows command-line PATH Frank Slootweg <this@ddress.is.invalid> - 2026-08-29 14:35 +0000
Re: PSA: How to add WSL grep to the Windwos command-line PATH Frank Slootweg <this@ddress.is.invalid> - 2026-08-27 20:09 +0000
Re: PSA: How to add WSL grep to the Windwos command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-30 20:32 -0600
Re: PSA: How to add WSL grep to the Windwos command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-30 20:53 -0600
Re: PSA: How to add WSL grep to the Windwos command-line PATH Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-31 05:34 +0000
Re: PSA: How to add WSL grep to the Windwos command-line PATH Frank Slootweg <this@ddress.is.invalid> - 2026-08-31 12:45 +0000
Re: PSA: How to add WSL grep to the Windwos command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-31 09:34 -0600
Re: PSA: How to add WSL grep to the Windwos command-line PATH Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-31 22:28 +0000
Re: PSA: How to add WSL grep to the Windwos command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-31 21:33 -0600
Re: PSA: How to add WSL grep to the Windwos command-line PATH Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-09-01 07:31 +0000
Re: PSA: How to add WSL grep to the Windwos command-line PATH Arno Welzel <usenet@arnowelzel.de> - 2026-09-02 17:44 +0200
Re: PSA: How to add WSL grep to the Windwos command-line PATH Arno Welzel <usenet@arnowelzel.de> - 2026-09-02 17:41 +0200
Re: PSA: How to add WSL grep to the Windwos command-line PATH Paul <nospam@needed.invalid> - 2026-09-02 14:50 -0400
Re: PSA: How to add WSL grep to the Windwos command-line PATH Arno Welzel <usenet@arnowelzel.de> - 2026-09-02 22:00 +0200
Re: PSA: How to add WSL grep to the Windwos command-line PATH Richard Kettlewell <invalid@invalid.invalid> - 2026-09-02 21:16 +0100
Re: PSA: How to add WSL grep to the Windwos command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-09-02 23:42 +0300
Re: PSA: How to add WSL grep to the Windwos command-line PATH Paul <nospam@needed.invalid> - 2026-09-02 21:36 -0400
Re: PSA: How to add WSL grep to the Windwos command-line PATH Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-09-03 02:28 +0000
Re: PSA: How to add WSL grep to the Windwos command-line PATH Paul <nospam@needed.invalid> - 2026-09-02 23:18 -0400
Re: PSA: How to add WSL grep to the Windwos command-line PATH Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-09-03 05:03 +0000
Re: PSA: How to add WSL grep to the Windwos command-line PATH "Carlos E.R." <robin_listas@es.invalid> - 2026-09-03 08:23 +0200
Re: PSA: How to add WSL grep to the Windwos command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-09-04 04:28 +0930
Re: PSA: How to add WSL grep to the Windwos command-line PATH Arno Welzel <usenet@arnowelzel.de> - 2026-09-04 18:37 +0200
Re: PSA: How to add WSL grep to the Windwos command-line PATH Dan Purgert <dan@djph.net> - 2026-09-02 19:51 +0000
Re: PSA: How to add WSL grep to the Windwos command-line PATH "Carlos E.R." <robin_listas@es.invalid> - 2026-09-02 22:05 +0200
Re: PSA: How to add WSL grep to the Windwos command-line PATH Dan Purgert <dan@djph.net> - 2026-09-02 20:25 +0000
Re: PSA: How to add WSL grep to the Windwos command-line PATH CDB <bellemarecd@gmail.com> - 2026-09-02 22:39 +0200
Re: PSA: How to add WSL grep to the Windwos command-line PATH Frank Slootweg <this@ddress.is.invalid> - 2026-08-31 14:24 +0000
Re: PSA: How to add WSL grep to the Windwos command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-31 11:50 -0600
Re: PSA: How to add WSL grep to the Windwos command-line PATH vallor <vallor@vallor.earth> - 2026-08-31 18:25 +0000
Re: PSA: How to add WSL grep to the Windwos command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-09-03 01:18 +0430
Re: PSA: How to add WSL grep to the Windwos command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-27 11:53 -0600
Re: PSA: How to add WSL grep to the Windwos command-line PATH Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-27 20:18 +0000
Re: PSA: How to add WSL grep to the Windwos command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-27 22:56 -0600
Re: PSA: How to add WSL grep to the Windwos command-line PATH "Carlos E. R." <robin_listas@es.invalid> - 2026-08-27 22:30 +0200
Re: PSA: How to add WSL grep to the Windwos command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-27 23:12 -0600
Re: PSA: How to add WSL grep to the Windows command-line PATH Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-28 06:34 +0000
Re: PSA: How to add WSL grep to the Windows command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-28 02:56 -0600
Re: PSA: How to add WSL grep to the Windows command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-29 16:40 -0600
Re: PSA: How to add WSL grep to the Windows command-line PATH Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-30 02:03 +0000
Re: PSA: How to add WSL grep to the Windows command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-29 23:05 -0600
Re: PSA: How to add WSL grep to the Windows command-line PATH Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-30 06:56 +0000
Re: PSA: How to add WSL grep to the Windows command-line PATH Paul <nospam@needed.invalid> - 2026-08-30 05:26 -0400
Re: PSA: How to add WSL grep to the Windows command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-30 08:23 -0600
Re: PSA: How to add WSL grep to the Windows command-line PATH Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-30 23:31 +0000
Re: PSA: How to add WSL grep to the Windwos command-line PATH "J.O. Aho" <user@example.net> - 2026-09-03 08:39 +0200
Re: PSA: How to add WSL grep to the Windwos command-line PATH Paul <nospam@needed.invalid> - 2026-08-27 04:36 -0400
Re: PSA: How to add WSL grep to the Windwos command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-27 10:45 -0600
Re: PSA: How to add WSL grep to the Windwos command-line PATH Paul <nospam@needed.invalid> - 2026-08-27 14:44 -0400
Re: PSA: How to add WSL grep to the Windwos command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-27 12:59 -0600
Re: PSA: How to add WSL grep to the Windwos command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-27 13:16 -0600
Re: PSA: How to add WSL grep to the Windwos command-line PATH Frank Slootweg <this@ddress.is.invalid> - 2026-08-27 19:41 +0000
Re: PSA: How to add WSL grep to the Windwos command-line PATH vallor <vallor@vallor.earth> - 2026-08-27 20:03 +0000
Re: PSA: How to add WSL grep to the Windwos command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-27 19:18 -0600
Re: PSA: How to add WSL grep to the Windwos command-line PATH Herbert Kleebauer <klee@unibwm.de> - 2026-08-28 12:13 +0200
Re: PSA: How to add WSL grep to the Windwos command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-28 09:51 -0600
Re: PSA: How to add WSL grep to the Windwos command-line PATH Herbert Kleebauer <klee@unibwm.de> - 2026-08-28 18:24 +0200
Re: PSA: How to add WSL grep to the Windwos command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-28 11:13 -0600
Re: PSA: How to add WSL grep to the Windwos command-line PATH Herbert Kleebauer <klee@unibwm.de> - 2026-08-28 19:36 +0200
Re: PSA: How to add WSL grep to the Windwos command-line PATH Frank Slootweg <this@ddress.is.invalid> - 2026-08-28 18:25 +0000
Re: PSA: How to add WSL grep to the Windwos command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-28 13:06 -0600
Re: PSA: How to add WSL grep to the Windwos command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-28 12:18 -0600
Re: PSA: How to add WSL grep to the Windwos command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-27 19:37 -0600
Re: PSA: How to add WSL grep to the Windwos command-line PATH Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-28 04:28 +0000
Re: PSA: How to add WSL grep to the Windwos command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-28 10:46 -0600
Re: PSA: How to add WSL grep to the Windows command-line PATH Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-28 01:21 +0000
Re: PSA: How to add WSL grep to the Windows command-line PATH Paul <nospam@needed.invalid> - 2026-08-27 22:21 -0400
Re: PSA: How to add WSL grep to the Windows command-line PATH Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-28 04:25 +0000
Re: PSA: How to add WSL grep to the Windows command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-27 23:35 -0600
Re: PSA: How to add WSL grep to the Windwos command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-28 10:25 -0600
Re: PSA: How to add WSL grep to the Windwos command-line PATH Paul <nospam@needed.invalid> - 2026-08-28 15:37 -0400
Re: PSA: How to add WSL grep to the Windwos command-line PATH "Carlos E. R." <robin_listas@es.invalid> - 2026-08-29 13:16 +0200
Re: PSA: How to add WSL grep to the Windwos command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-29 16:27 -0600
Re: PSA: How to add WSL grep to the Windwos command-line PATH Arno Welzel <usenet@arnowelzel.de> - 2026-08-30 12:58 +0200
Re: PSA: How to add WSL grep to the Windwos command-line PATH "Kerr-Mudd, John" <admin@127.0.0.1> - 2026-08-30 12:48 +0100
Re: PSA: How to add WSL grep to the Windwos command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-30 08:23 -0600
Re: PSA: How to add WSL grep to the Windwos command-line PATH Brian Gregory <void-invalid-dead-dontuse@email.invalid> - 2026-08-31 01:15 +0100
Re: PSA: How to add WSL grep to the Windwos command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-30 20:19 -0600
Page 1 of 6 [1] 2 3 4 5 6 Next page →
| From | Maria Sophia <mariasophia@comprehension.com> |
|---|---|
| Date | 2026-08-26 20:08 -0600 |
| Subject | PSA: How to add WSL grep to the Windwos command-line PATH |
| Message-ID | <116o67j$1uct$1@nnrp.usenet.blueworldhosting.com> |
PSA: How to add WSL grep to the Windows command-line PATH
This is an Android:Windows cross-platform problem that I run into every
day because most adb examples we find on the net use grep (not findstr).
It's a PITA to constantly convert adb examples using grep to findstr.
So this approach below is what I just decided to finally do after getting
tired of converting adb|grep examples found on the net to findstr syntax.
I recognize there are many ways to add "grep" to the Windows path.
But, since I already had WSL installed for other reasons, it bothered me
that I couldn't just call the Ubuntu grep from the Windows command line.
What good is WSL if you can't use it when you need it?
Hence, I came up with this method of calling the WSL grep from Windows.
It may be one of the simplest methods to run any WSL Linux tool directly
from the Windows CMD (or powershell) using a simple wrapper script.
But I've only tested it just now with just grep (not sed, awk, ls, etc.).
Unfortunately, WSL Linux binaries aren't normal Windows executables.
Hence, just adding the WSL Linux binary to Windows PATH
won't make CMD able to execute it. That would be too easy.
But this method just now worked perfectly, for me, on Windows 10.
Here's the sample x-platform adb:android:windows command we want to run.
C:\> adb shell pm list packages | grep -i gsf
'grep' is not recognized as an internal or external command,
operable program or batch file.
Of course, we've all used CYGWIN and other UNIX binaries in the
past, but I already have WSL so why not use the grep it came with.
First, let's prove WSL 1 is installed and working.
C:\> wsl --list --verbose
NAME STATE VERSION
* Ubuntu Stopped 1
And, let's prove WSL has a working grep too.
C:\> wsl grep --version
grep (GNU grep) 3.11
Since it's there, let's add a "grep.cmd" to a file in our path:
C:\> gvim C:\path-to\grep.cmd
@wsl grep %*
Then test from anywhere on the command line:
C:\> grep --version
grep (GNU grep) 3.11
Let's get back to what we were doing, which was testing GSF:
C:\> adb shell pm list packages | grep -i gsf
package:com.google.android.gsf
Voila!
I haven't tested any of the other WSL Linux commands, but from this simple
grep test, I would hope that the others (sed, awk, etc.) should work too.
Do they?
--
On Usenet, kind hearted people try to help each other all day every day.
[toc] | [next] | [standalone]
| From | Maria Sophia <mariasophia@comprehension.com> |
|---|---|
| Date | 2026-08-27 00:05 -0600 |
| Message-ID | <116ok3j$1n21$1@nnrp.usenet.blueworldhosting.com> |
| In reply to | #195241 |
Maria Sophia wrote:
> PSA: How to add WSL grep to the Windows command-line PATH
>
> This is an Android:Windows cross-platform problem that I run into every
> day because most adb examples we find on the net use grep (not findstr).
>
> It's a PITA to constantly convert adb examples using grep to findstr.
>
> So this approach below is what I just decided to finally do after getting
> tired of converting adb|grep examples found on the net to findstr syntax.
>
> I recognize there are many ways to add "grep" to the Windows path.
> But, since I already had WSL installed for other reasons, it bothered me
> that I couldn't just call the Ubuntu grep from the Windows command line.
>
> What good is WSL if you can't use it when you need it?
>
> Hence, I came up with this method of calling the WSL grep from Windows.
>
> It may be one of the simplest methods to run any WSL Linux tool directly
> from the Windows CMD (or powershell) using a simple wrapper script.
>
> But I've only tested it just now with just grep (not sed, awk, ls, etc.).
>
> Unfortunately, WSL Linux binaries aren't normal Windows executables.
>
> Hence, just adding the WSL Linux binary to Windows PATH
> won't make CMD able to execute it. That would be too easy.
>
> But this method just now worked perfectly, for me, on Windows 10.
>
> Here's the sample x-platform adb:android:windows command we want to run.
> C:\> adb shell pm list packages | grep -i gsf
> 'grep' is not recognized as an internal or external command,
> operable program or batch file.
>
> Of course, we've all used CYGWIN and other UNIX binaries in the
> past, but I already have WSL so why not use the grep it came with.
>
> First, let's prove WSL 1 is installed and working.
> C:\> wsl --list --verbose
> NAME STATE VERSION
> * Ubuntu Stopped 1
>
> And, let's prove WSL has a working grep too.
> C:\> wsl grep --version
> grep (GNU grep) 3.11
>
> Since it's there, let's add a "grep.cmd" to a file in our path:
> C:\> gvim C:\path-to\grep.cmd
> @wsl grep %*
>
> Then test from anywhere on the command line:
> C:\> grep --version
> grep (GNU grep) 3.11
>
> Let's get back to what we were doing, which was testing GSF:
> C:\> adb shell pm list packages | grep -i gsf
> package:com.google.android.gsf
>
> Voila!
>
> I haven't tested any of the other WSL Linux commands, but from this simple
> grep test, I would hope that the others (sed, awk, etc.) should work too.
>
> Do they?
Since this simple method should work for many common Linux commands...
C:\> gvim C:\path-to\sed.cmd
@wsl sed %*
C:\> where sed
C:\path-to\sed.cmd
C:\> adb shell dumpsys battery | sed "s/ */ /g"
Current Battery Service state:
AC powered: false
USB powered: true
Wireless powered: false
Charge counter: 2916540
...
I wrote up this wsl2cli batch script so everyone can benefit more easily.
I haven't actually tested whether the commands work, but they should.
Shouldn't they?
:: ------------------------------------------------------------------------
:: wsl2cli.bat
:: Bridge common WSL Linux utilities into Windows CMD/PowerShell by
:: generating wrapper scripts in Windows that call existing WSL binaries
:: ------------------------------------------------------------------------
:: v1p8 20260826 Added keyword support (exit, quit, q) for graceful exit
:: v1p7 20260826 Switched echo. to echo: to prevent command interpreter quirks
:: v1p6 20260826 Commented out debug lines for clean production output
:: v1p5 20260826 Added ignore of empty-path tokens from trailing semicolons
:: v1p4 20260826 Added debug tracking lines inside the PATH parsing loop
:: v1p3 20260826 Fixed path evaluation bug by quoting paths in the loop
:: v1p2 20260826 Output the current PATH filespecs for easier selection
:: v1p1 20260826 Added ability to put cmd files where desired by number
:: v1p0 20260826 Make Linux commands that work in CMD using WSL calls
:: ------------------------------------------------------------------------
@echo off
setlocal EnableDelayedExpansion
echo:
echo WSL-to-CMD Wrapper Generator
echo Inspecting the Windows PATH environment variable...
echo Select the destination folder where the scripts should be placed:
echo:
:: [DEBUG] echo Entering PATH parsing loop...
set "count=0"
for %%p in ("%PATH:;=" "%") do (
call :processpath %%p
)
:: [DEBUG] echo Loop complete. Total items found: %count%
goto :postloop
:processpath
if "%~1"=="" exit /b
set /a count+=1
set "cleanPath=%~1"
:: [DEBUG] echo count=%count% ^| raw=%1 ^| clean=%cleanPath%
set "pathItem[%count%]=%cleanPath%"
echo (%count%) "%cleanPath%"
exit /b
:postloop
set /a customOpt=count+1
set /a exitOpt=count+2
echo (%customOpt%) Enter a custom path manually
echo (%exitOpt%) Exit / Abort
echo:
set /p "choice=Enter choice (1-%exitOpt%): "
:: Handle graceful exit by number or text keyword
if "%choice%"=="%exitOpt%" goto :gracefulExit
if /i "%choice%"=="exit" goto :gracefulExit
if /i "%choice%"=="quit" goto :gracefulExit
if /i "%choice%"=="q" goto :gracefulExit
goto :checkCustom
:gracefulExit
echo Exiting. No changes made.
goto :end
:checkCustom
:: Handle custom path
if "%choice%"=="%customOpt%" (
set /p "targetDir=Enter full target path (e.g., C:\bin): "
goto :process
)
:: Handle PATH selection
set "targetDir="
for /l %%i in (1, 1, %count%) do (
if "%choice%"=="%%i" set "targetDir=!pathItem[%%i]!"
)
:process
:: Validate final target directory
if not defined targetDir (
echo [Error] Invalid selection. Aborting.
goto :end
)
:: Create directory if it doesn't exist yet
if not exist "%targetDir%" (
echo Directory doesn't exist. Creating it now...
mkdir "%targetDir%"
)
echo:
echo Generating WSL wrapper scripts into:
echo -> %targetDir%
echo:
:: Define a list of core Linux commands to wrap for the Windows CLI
set "cmds=grep sed awk cut sort uniq wc tr head tail cat less more tee ls cp mv rm touch mkdir find xargs basename dirname diff comm paste join"
:: Create the wrapper
for %%c in (%cmds%) do (
echo Creating %%c.cmd
echo @wsl %%c %%* > "%targetDir%\%%c.cmd"
)
echo:
echo All wrapper scripts created successfully!
echo Since the target directory is already in the PATH, the commands can be used immediately.
echo:
:end
pause
:: end of wsl2cli.bat
--
On Usenet, some people are kind, helpful and they're knowledgeable too!
[toc] | [prev] | [next] | [standalone]
| From | Lawrence D’Oliveiro <ldo@nz.invalid> |
|---|---|
| Date | 2026-08-27 07:13 +0000 |
| Message-ID | <116oo25$18oc6$1@dont-email.me> |
| In reply to | #195243 |
On Thu, 27 Aug 2026 00:05:41 -0600, Maria Sophia wrote: > Since this simple method should work for many common Linux > commands... How many of these do you have to write before it becomes simpler just to run a Linux system?
[toc] | [prev] | [next] | [standalone]
| From | "R.Wieser" <address@is.invalid> |
|---|---|
| Date | 2026-08-27 10:02 +0200 |
| Message-ID | <116oqvf$19mrb$1@dont-email.me> |
| In reply to | #195244 |
Lawrence, >> Since this simple method should work for many common Linux >> commands... > > How many of these do you have to write before it becomes simpler just > to run a Linux system? Besides that he just ignores that for his method to work we first need to install gvim ?... The OP is *very good* at finding "solutions", but rather bad at checking if it will work anywhere outside his own "it works here" situation (read: seldom any error-checking etc). Ofcourse, on Windows the batch-interpreter also supports equates like that - iow, no need for gvim. :-) As for the value of his PSA ? Next-to-none. A quick "how to run wsl grep from the commandline" websearch turned up this (second result) : https://www.commandlinewizardry.com/post/running-linux-commands-within-windows-using-wsl , which pretty-much states the obvious : just use "wsl grep"(.cmd) instead of just "grep"(.cmd) Ofcourse, a bit of editing the registry would work as well (catching the ".cmd" extension like any other "needs to be run by" extensions) , without the need to write an equate for each of those WSL commands. Oh well. Regards, Rudy Wieser
[toc] | [prev] | [next] | [standalone]
| From | Maria Sophia <mariasophia@comprehension.com> |
|---|---|
| Date | 2026-08-27 12:14 -0600 |
| Message-ID | <116puql$7ee$1@nnrp.usenet.blueworldhosting.com> |
| In reply to | #195246 |
Hi Rudy,
While we've searched for decades to find any useful scripts from you,
I realize you've never been particularly reluctant to criticize my
kind-hearted scripts such as this latest script which I wrote so that
others can run more easily most of the common WSL commands on Windows.
But let's separate the snark from the actual issue, because your first
point is easily answered.
No, you do not need to install gvim to create a one-line .cmd file.
To be polite to you, I'll explain I used gvim because I already use it.
You can create the file from the command line just as easily, for example:
C:\> echo @wsl grep %%* > grep.cmd
So that's not really a problem even as it's your most important criticism.
As for the rest of your response, I think you're missing the point of the
PSA.
Yes, of course someone can type:
C:\> wsl grep -i gsf
When you re-read the OP, you'll see that's not what I was trying to solve.
The problem I was solving for people who already have WSL installed, is
that Android documentation & examples routinely give us commands such as:
adb shell pm list packages | grep -i gsf
When I'm working at the Windows command line, I don't want to stop and
translate every Unix pipeline I encounter into Windows syntax.
I already have WSL installed. I already have Ubuntu. I already have grep.
The 1-line grep.cmd wrapper makes the existing command work as written.
That's the entire point.
It's brilliant, if you ask me, given one line solves the entire problem.
And yes, I'm perfectly aware that a web search can turn up instructions for
using wsl grep. The fact that somebody else has documented a related
solution doesn't make a PSA explaining a particularly simple implementation
worthless. If that were the standard, we could dismiss an enormous
percentage of posts with "Google already knows that" tirades like yours.
More importantly, I wasn't claiming to have discovered some previously
unknown Windows feature. I was sharing something so simple that it's a
single line of code that solved an annoyance for me, because I thought it
might solve the same annoyance for someone else.
I realize you're not about helping others in every thread you author.
But I am.
You also seem to be evaluating the idea as though I proposed creating a
.cmd wrapper for every Linux command on the planet. I didn't.
If I eventually find myself needing a hundred Linux commands from the
Windows command line, then perhaps the suggestion to use Linux becomes
compelling. I'm done with dual-boot Linux/Windows.
It works, of course.
But once Apple sealed the hole with iFuse, dual-boot became irrelevant.
For interoperability, dual boot no longer adds much value over WSL.
If I need one or two commands that frequently appear in adb examples, a
one-line wrapper is considerably less disruptive than dual booting is.
In my humble opinion, a 1-line fix is a perfectly reasonable tradeoff.
So I don't particularly understand your clear hostility toward the PSA.
Especially your hostility toward gvim, which is after all, a common editor.
This PSA contains a small, practical interoperability trick, offered for
people who already have WSL installed and who then might find it useful.
Nobody has to use it.
But "I can find a different way to do this" isn't really a refutation of
the fact that the single-line solution which I outlined works or that
somebody else might find it convenient when running adb on Windows.
And regarding your comment about error checking,. grep.cmd isn't pretending
to be a complete Linux compatibility layer. It's a one-line pass-through
wrapper whose entire purpose is to invoke wsl grep. Expecting it to contain
elaborate error handling seems to be solving a considerably different
problem from the one I was addressing.
So yes, Rudy, there are other ways to accomplish this, but you didn't
provide any given the assumption was two fold in the original post.
a. The user already has WSL installed & wants to use it in the CLI
b. The user is copying and pasting adb commands which use pipes to grep
The second post was solving a different problem, by the way, since I wrote
it to *help others* solve the same problem, in toto, running a single line!
C:\> wsl2cli.bat
Voila!
*One line solves the entire stated problem set!*
If the user has WSL installed, that will add to the Windows command line
most of the important linux commands which common adb commands pipe to.
I am not aware that this elegant solution is documented anywhere on Usenet.
It may be. But if it is, I simply ask you to find where it's documented.
I posted this PSA to help people.
That's rather the point of sharing solutions on Usenet.
Different people can choose the one that fits their workflow.
So yes, Rudy ... there are other ways to accomplish this.
But none are as elegant as the single-line solution I proposed in this PSA.
If you find a solution that is less than a single line, let us all know.
--
Usenet is where kind-hearted well-educated people gather to share ideas.
[toc] | [prev] | [next] | [standalone]
| From | "R.Wieser" <address@is.invalid> |
|---|---|
| Date | 2026-08-27 22:06 +0200 |
| Message-ID | <116q5cm$1pfjo$1@dont-email.me> |
| In reply to | #195254 |
Arlen, > While we've searched for decades to find any useful scripts from you, And that is how its supposed to be. I *help*. I normally do not write someones code for them - as you should know by now. > I realize you've never been particularly reluctant to criticize my > kind-hearted scripts Don't bullshit us. Your "kind-hearted scripts" are more often convoluted and ill thought-out danger-zones than not - as I have mentioned (and sometimes also explained) multiple times. > such as this latest script which I wrote so that > others can run more easily most of the common WSL commands on Windows. You included a script ? Where ? I've tried to help you quite a number of times - and between the lines even here - but you always rejected such help. And a freebee : have you already checked if that gvim equate method is permanent ? Or does it disappear the moment you close the command-console ? I would check that if I where you ... Regards, Rudy Wieser
[toc] | [prev] | [next] | [standalone]
| From | Maria Sophia <mariasophia@comprehension.com> |
|---|---|
| Date | 2026-08-27 20:39 -0600 |
| Message-ID | <116qsd5$1cje$1@nnrp.usenet.blueworldhosting.com> |
| In reply to | #195265 |
R.Wieser wrote: > You included a script ? Where ? Here... Newsgroups: alt.comp.os.windows-10,comp.mobile.android,alt.msdos.batch,alt.os.linux Subject: Re: PSA: How to add WSL grep to the Windwos command-line PATH Date: Thu, 27 Aug 2026 00:05:41 -0600 Message-ID: <116ok3j$1n21$1@nnrp.usenet.blueworldhosting.com> Furthermore, below is the comment section which explains what it does... :: ------------------------------------------------------------------------ :: wsl2cli.bat :: Bridge common WSL Linux utilities into Windows CMD/PowerShell by :: generating wrapper scripts in Windows that call existing WSL binaries :: ------------------------------------------------------------------------ :: v1p8 20260826 Added keyword support (exit, quit, q) for graceful exit :: v1p7 20260826 Switched echo. to echo: to prevent command interpreter quirks :: v1p6 20260826 Commented out debug lines for clean production output :: v1p5 20260826 Added ignore of empty-path tokens from trailing semicolons :: v1p4 20260826 Added debug tracking lines inside the PATH parsing loop :: v1p3 20260826 Fixed path evaluation bug by quoting paths in the loop :: v1p2 20260826 Output the current PATH filespecs for easier selection :: v1p1 20260826 Added ability to put cmd files where desired by number :: v1p0 20260826 Make Linux commands that work in CMD using WSL calls :: ------------------------------------------------------------------------ Basically, it allows anyone on Windows with WSL already installed to run any of the given Linux commands after executing this single setup script. -- The job of a Usenet post is to add useful value each time we communicate.
[toc] | [prev] | [next] | [standalone]
| From | "R.Wieser" <address@is.invalid> |
|---|---|
| Date | 2026-08-28 14:35 +0200 |
| Message-ID | <116rvae$2be7j$1@dont-email.me> |
| In reply to | #195282 |
Arlen, [re-inserted from my previous post] >>> such as this latest script which I wrote so that others >>> can run more easily most of the common WSL commands on Windows. [end re-insert] >> >> You included a script ? Where ? > > Here... [snip] Ah yes. Not quoting what I replied to, and than trying to make it sound as if my response/question was about something else altogether. Not at all obvious ofcourse. no sir, not at all ! :-D Regards, Rudy Wieser
[toc] | [prev] | [next] | [standalone]
| From | Maria Sophia <mariasophia@comprehension.com> |
|---|---|
| Date | 2026-08-28 14:47 -0600 |
| Message-ID | <116ss5s$7j2$1@nnrp.usenet.blueworldhosting.com> |
| In reply to | #195299 |
UPDATE
I think we're solved the AWK problem, thanks to the help from many others.
C:\> adb shell pm list packages | awk -F: "{print \$2}" | grep shiz
moe.shizuku.privileged.api
C:\> adb shell pm list packages | wsl awk "{sub(/^package:/, \"\"); print}" | grep shizu
moe.shizuku.privileged.api
C:\> adb shell dumpsys battery | wsl tr -d '\r' | wsl awk "/level:/ {print \"Battery Level:\", \$2 \"%\"}"
Battery Level: 93%
Previously we had to pass the entire instruction string via adb shell
to bypass local Windows parsing, letting Android's built-in toybox/busybox awk
handle the script natively without any WSL or .cmd wrapper gymnastics.
C:\> adb shell "dumpsys battery | awk '/level:/ {print \"Battery Level:\", $2 \"%\"}'"
But now, with the awk.cmd set up, we can run these WSL awk examples.
C:\> type awk.cmd
@wsl awk %*
C:\> adb shell pm list packages | awk -F: "{print \$2}"
moe.shizuku.privileged.api
C:\> adb shell pm list packages | awk "{sub(/^package:/, \"\"); print}"
moe.shizuku.privileged.api
C:\> adb shell dumpsys battery | tr -d '\r' | awk "/level:/ {print \"Battery Level:\", \$2 \"%\"}"
Battery Level: 92%
Overall, we've had success based on the excellent recommendations from Paul
(who was instrumental in adding the Rust CoreUtils to the discussion),
but also the helpful recommendations from Herbert & Lawrence and the
useful criticisms brought up by Frank, Carlos & vallor to flesh out ideas.
Given the recent release of Microsoft Rust Utils, it's useful to note that most of the WSL commands can be considered moot given we now have native implementations which are already included in the path for 75 utilities.
Running this command garners, AFAICT, most of what this PSA is about.
C:\> winget install Microsoft.Coreutils
Since every post should add value, here's a catalogue of what it added.
File & Directory Operations:
cp, mv, rm, mkdir, rmdir, ls, ln, link, unlink, touch, pwd, basename,
dirname, realpath, readlink
Text Processing & Display:
cat, tac, head, tail, echo, printf, tee, wc, grep, sort, uniq, cut,
paste, join, comm, fold, fmt, tr, expand, unexpand, split, csplit, nl,
od, seq, shuf, ptx
Checksums & Formatting:
md5sum, sha1sum, sha224sum, sha256sum, sha384sum, sha512sum, b2sum,
cksum, sum, numfmt, factor, expr
Environment & System Info:
arch, nproc, uname, hostname, uptime, date, sleep, true, false, yes,
test, env, printenv, whoami, coreutils-manager
File Management & Attributes:
df, du, stat, truncate, mktemp, pathchk, install, find, xargs
Notably missing are apparently these, which WSL2CLI.bat might be used
to add as per the original PSA post, but only after testing them.
Text & Pattern Processing:
awk, sed
Archiving & Compression:
tar, gzip, gunzip, bzip2, zip, unzip
File Comparison & Patching:
diff, patch, cmp
Pagination:
less, more
Networking:
curl, wget, netcat, ssh
Shells & Scripting:
bash, sh
Here are some working examples of what we've been able to accomplish.
First, elevate the shell privileges and then check elevated-shell status
C:\> adb shell sh /storage/emulated/0/Android/data/moe.shizuku.privileged.api/start.sh
C:\> adb shell ps -A | grep -i shizuku
u0_a828 20618 901 6490828 151572 0 0 S moe.shizuku.privileged.api
shell 20817 1 5139096 88596 SyS_epoll_wait 0 S shizuku_server
Sort the shizuku processes by order of occurrence
C:\> adb shell ps -A | grep -i shizuku | sort -nk2
u0_a828 20618 901 6490828 148484 0 0 S moe.shizuku.privileged.api
shell 20817 1 5139096 88320 SyS_epoll_wait 0 S shizuku_server
Filter package names for shizuku
C:\> adb shell pm list packages | cut -d: -f2 | grep shiz
moe.shizuku.privileged.api
Count total packages that the user installed themslves
C:\> adb shell pm list packages | wc -l
1021
Check the battery level
C:\> adb shell dumpsys battery | awk '/level:/ {print "Battery Level:", $2 "%"}' | tr -d '\r'
Battery Level: 92%
Retrieve wi-fi ip addres
C:\> C:\app\editor\android\scrcpy> adb shell ip addr show wlan0 | awk '/inet / {print "IP Address:", $2}'
IP Address: 192.168.1.4/24
--
Usenet allows helpful experts around the world combine their experiences.
[toc] | [prev] | [next] | [standalone]
| From | Lawrence D’Oliveiro <ldo@nz.invalid> |
|---|---|
| Date | 2026-08-27 20:19 +0000 |
| Message-ID | <116q65b$1pm9l$2@dont-email.me> |
| In reply to | #195254 |
On Thu, 27 Aug 2026 12:14:45 -0600, Maria Sophia wrote: > When I'm working at the Windows command line, I don't want to stop > and translate every Unix pipeline I encounter into Windows syntax. Maybe it would be simpler to work at a Linux/Unix command line, then you could skip this translation step.
[toc] | [prev] | [next] | [standalone]
| From | "Carlos E. R." <robin_listas@es.invalid> |
|---|---|
| Date | 2026-08-27 22:31 +0200 |
| Message-ID | <nfbl4mFl2vlU4@mid.individual.net> |
| In reply to | #195268 |
On 2026-08-27 22:19, Lawrence D’Oliveiro wrote:
> On Thu, 27 Aug 2026 12:14:45 -0600, Maria Sophia wrote:
>
>> When I'm working at the Windows command line, I don't want to stop
>> and translate every Unix pipeline I encounter into Windows syntax.
>
> Maybe it would be simpler to work at a Linux/Unix command line, then
> you could skip this translation step.
Indeed. Using adb for Linux.
--
Cheers,
Carlos E.R.
ES🇪🇸, EU🇪🇺.
[toc] | [prev] | [next] | [standalone]
| From | Maria Sophia <mariasophia@comprehension.com> |
|---|---|
| Date | 2026-08-27 20:33 -0600 |
| Message-ID | <116qs19$1a7e$1@nnrp.usenet.blueworldhosting.com> |
| In reply to | #195271 |
Carlos E. R. wrote:
>>> When I'm working at the Windows command line, I don't want to stop
>>> and translate every Unix pipeline I encounter into Windows syntax.
>>
>> Maybe it would be simpler to work at a Linux/Unix command line, then
>> you could skip this translation step.
>
> Indeed. Using adb for Linux.
Thank you Carlos & Lawrence for your kind suggestions for improvement!
All these suggestions are welcome as they improve our interop capabilities.
1. Circa 1996 GNU utils/POSIX compatibility layer (e.g., Cygwin)
2. Late 1990s/early 2000s Linux OS inside a conventional VMware VM
(1999 VMware Workstation, 2007 VirtualBox, 2008 Hyper-V, etc.)
3. Circa 2016 WSL 1 translation layer (allowing @wsl wrappers)
4. Circa 2020 WSL 2 (real Linux kernel inside a lightweight VM)
5. Mid 2026 Microsoft's native Rust-based Coreutils for Windows
While this helpful suggestion posed by multiple people of setting up adb
inside a Linux VM to talk to the phone hardware over native Linux adb
protocols might be worthwhile, we also have to remember our combined
experiences with VMs and physical hardware in the past.
I, for one, have wasted far too many hours trying to make VMs work.
Particularly when they need to use PC hardware to access outside devices.
At least in my experience, that implies that a Linux VM can be an even
worse implementation than Cygwin, but for very different reasons.
The problem isn't running Linux inside the VM, mind you. The problem is the
boundary between the guest and the Windows host, especially when physical
devices and native Windows executables are involved.
For my use case, I want Linux tooling inside the Windows command-line
environment, without giving up the Windows environment I'm actually working
in.
WSL 1 gives us a Linux userspace and, with WSL 2, a real Linux kernel.
At the same time, we can still work with Windows processes, files, devices,
and tools, which is where I have found VM solutions lacking in the past.
As for the suggestion of Cygwin, I've been there and done that, but I admit
I gave up on Cygwin maybe, oh, fifteen or even twenty five years ago, and
haven't looked back to see if Cygwin has fundamentally improved since then.
Cygwin has a different problem than running Linux inside of a VM.
Cygwin creates a POSIX-compatibility environment on top of Windows, which
can introduce mismatches in handle mapping and line endings (\r\n vs \n)
when piping output directly from a native Win32 executable such as adb.exe.
Certainly we can make Cygwin work, but, as I noted, I gave up on Cygwin
decades ago, so unless it has improved greatly, it's not what I'll test.
That's ultimately why my helpful public-service announcement was focused on
WSL but I do think now, after testing briefly Paul's and Frank's suggestion
of the brand new Microsoft CoreUtils, that they may be a simpler solution.
In reality, given the paucity of coreUtils implementations, (e.g., my
CoreUtils has grep, but not awk or sed), I think a possible solution is to
combine both the WSL and CoreUtils capabilities, if the tests work out.
C:\> winget install Microsoft.Coreutils
C:\> setx PATH "%PATH%;C:\Program Files\coreutils"
C:\> where grep
C:\Program Files\coreutils\bin\grep.exe
C:\Users\username\adb\grep.cmd
C:\> where sed
C:\Users\username\adb\sed.cmd
C:\> where awk
C:\Users\username\adb\awk.cmd
C:\> where tr
C:\Program Files\coreutils\bin\tr.exe
C:\Users\username\adb\tr.cmd
Since this detailed agreement is long, I'll test representative
adb commands using the above Linux commands to see how it works out.
Thank you Carlos & Lawrence for your kind suggestions for improvement!
--
Usenet isn't for amusement; it's for learning from and teaching each other.
[toc] | [prev] | [next] | [standalone]
| From | Lawrence D’Oliveiro <ldo@nz.invalid> |
|---|---|
| Date | 2026-08-28 04:59 +0000 |
| Message-ID | <116r4jo$218ss$8@dont-email.me> |
| In reply to | #195281 |
On Thu, 27 Aug 2026 20:33:13 -0600, Maria Sophia wrote: > At least in my experience, that implies that a Linux VM can be an > even worse implementation than Cygwin, but for very different > reasons. Linux VMs are used heavily in mission-critical deployments. Your experience might explain why even Microsoft’s cloud is predominantly Linux-based rather than Windows-based. I have a client running essentially his entire business on this <https://xcp-ng.org/>, with this <https://xen-orchestra.com/> as the GUI front-end.
[toc] | [prev] | [next] | [standalone]
| From | Maria Sophia <mariasophia@comprehension.com> |
|---|---|
| Date | 2026-08-30 21:03 -0600 |
| Message-ID | <1172quj$2fec$1@nnrp.usenet.blueworldhosting.com> |
| In reply to | #195289 |
Lawrence D¢Oliveiro wrote: > On Thu, 27 Aug 2026 20:33:13 -0600, Maria Sophia wrote: > >> At least in my experience, that implies that a Linux VM can be an >> even worse implementation than Cygwin, but for very different >> reasons. > > Linux VMs are used heavily in mission-critical deployments. Hi Lawrence, In my humble experience, admittedly maybe a decade or more ago, the problem with running operating systems inside of a VM is talking to peripherals. So I shy away from VMs as I've been burned in the past, even as WSL is a VM, and I shy away from Cygwin-like solutions, also because I've been had. Anyway, I think we've elegantly brilliantly solved the problem set nicely. 1. C:\> winget install Microsoft.Coreutils 2. C:\> wsl --install 3. C:\> wsl2cli.bat That's three commands. It's ingenious, is it not! I *love* brilliantly simple elegant solutions to difficult problem sets! I really do. That simple sequence adds most of Linux to the Windows command line path. In fact... If anyone has a *simpler* more elegant solution than that, let us know! (I will update the wsl2cli.bat later to remove the CoreUtils duplication.) -- Sometimes it takes a group of people to come up with the perfect solution.
[toc] | [prev] | [next] | [standalone]
| From | Frank Slootweg <this@ddress.is.invalid> |
|---|---|
| Date | 2026-08-27 10:22 +0000 |
| Message-ID | <116pa6h.948.1@ID-201911.user.individual.net> |
| In reply to | #195244 |
Lawrence D?Oliveiro <ldo@nz.invalid> wrote: > On Thu, 27 Aug 2026 00:05:41 -0600, Maria Sophia wrote: > > > Since this simple method should work for many common Linux > > commands... > > How many of these do you have to write before it becomes simpler just > to run a Linux system? And make sure that you can no longer run any of your Windows software? [1] But to the point: Don't confuse "Arlen"'s convoluted methods with what most others are doing. There are many solutions for running Unix/UNIX/GNU commands on Windows. Paul mentions one. I'm using another since well over two decades (see User-Agent: header) and have been using similar solutions since the early MS-DOS days. This is a total non-'problem'. [1] This is one of them rhetorical thingies.
[toc] | [prev] | [next] | [standalone]
| From | Maria Sophia <mariasophia@comprehension.com> |
|---|---|
| Date | 2026-08-27 11:36 -0600 |
| Message-ID | <116psi8$i33$1@nnrp.usenet.blueworldhosting.com> |
| In reply to | #195249 |
Frank Slootweg wrote: > Don't confuse convoluted methods with what most others are doing. Hi Frank, You're so desperate to insult me that you didn't even read what I wrote. The simple solution I came up with on my own is so brilliant that it took me nothing but a 1-line file in the path to completely solve my grep issue. Hence, almost everything you said was factually dead wrong, Frank. When you grow up, you'll learn to read what I had written to understand it. The fact you never could complete high school is telling in your posts. Next time, read what I wrote and understand it before throwing insults. Almost everything you claimed is dead wrong, but you don't even realize it. Because your real intent was to satisfy your desperate need to insult me. You have no desire to help anyone, Frank. You're a despicable sadistic wholly unprepossessing ignorant human being. In your response, if any, please indicate you read & understood the method. Otherwise, it's obvious that you only have your own disgusting purposes.
[toc] | [prev] | [next] | [standalone]
| From | Maria Sophia <mariasophia@comprehension.com> |
|---|---|
| Date | 2026-08-27 12:39 -0600 |
| Message-ID | <116q08t$a82$1@nnrp.usenet.blueworldhosting.com> |
| In reply to | #195252 |
If others wonder why I responded to "Frank Slootweg" the way I did, they first need to know he's a common troll who has infested Usenet for decades. Newsgroups: comp.mobile.android Subject: Politely asking the Frank Slootweg common troll to cut it out Date: Thu, 23 Oct 2025 12:34:40 -0600 Message-ID: <10ddsg0$1l6t$1@nnrp.usenet.blueworldhosting.com> Nonetheless, in respect to the others whose intent is to benefit from every Usenet thread, below is a response to what Frank Slootweg asked. =====< First sentence from Frank who deserves a technical answer: >===== And make sure that you can no longer run any of your Windows software? [1] I think this was directed toward Lawrence's idea, which, I give Frank credit for, since running grep on Windows versus running Linux are two completely different things. As I had noted prior, the solution I propose is a single line. To run Linux instead of a single line seems disproportionately off kilter. =====< Second sentence from Frank who deserves a technical answer: >===== But to the point: Don't confuse this convoluted methods with what most others are doing. I read that with disbelief, as Frank is apparently disproportionately off kilter in this second line, since he has no better of a solution. So I must ask Frank Slootweg directly: Q: How does he propose we solve this problem in less than a single line? A: ? If Frank Slootweg can't answer that question, then his remark that a single line is a "convoluted method" falls shockingly obviously flat, does it not? =====< Third sentence from Frank who deserves a technical answer: >===== There are many solutions for running Unix/UNIX/GNU commands on Windows. Paul mentions one. I'm using another since well over two decades (see User-Agent: header) and have been using similar solutions since the early MS-DOS days. This is a total non-'problem'. Regarding Paul's suggested solution, while Paul volunteered that kind-hearted suggestion, it doesn't solve the stated problem at all. a. You already have WSL b. You want to use grep in adb copy/paste commands If others didn't read the response to Paul's kind-hearted suggestion, grep isn't even included in the RUST suite, and, it's more than just one step. That doesn't mean Microsoft Coreutils for Windows isn't useful for other purposes, but it doesn't solve the stated problem set of merging WSL & CLI. BTW, I installed Microsoft Coreutils for Windows, so I will test it out. But for other reasons, such as to understand more of how we can use it. =====< Fourth sentence from Frank who deserves a technical answer: >===== [1] This is one of them rhetorical thingies. I think Frank is referring here to Lawrence's kind-hearted suggestion of "just use Linux", but that was never going to be the answer to the problem. The problem set was clearly stated (or so I had thought) in the OP: A. WSL is already installed & the user merely wants to use it from the CLI B. Many adb command examples are provided using pipes to things like grep For *that* problem set, if anyone reading this can find a more elegant, more brilliant, more simple solution than a single-line file, let us know! The whole point of Usenet is to learn from & to teach each other. -- Usenet is a team sport where each person adds unique value their own way.
[toc] | [prev] | [next] | [standalone]
| From | "Carlos E. R." <robin_listas@es.invalid> |
|---|---|
| Date | 2026-08-27 22:20 +0200 |
| Message-ID | <nfbkh2Fl2vkU1@mid.individual.net> |
| In reply to | #195256 |
On 2026-08-27 20:39, Maria Sophia wrote:
> If others wonder why I responded to "Frank Slootweg" the way I did, they
> first need to know he's a common troll who has infested Usenet for decades.
No, he is not.
Ignoring the rest of your post.
--
Cheers,
Carlos E.R.
ES🇪🇸, EU🇪🇺.
[toc] | [prev] | [next] | [standalone]
| From | Frank Slootweg <this@ddress.is.invalid> |
|---|---|
| Date | 2026-08-28 18:07 +0000 |
| Message-ID | <116spqh.9n8.1@ID-201911.user.individual.net> |
| In reply to | #195256 |
Maria Sophia <mariasophia@comprehension.com> wrote: > If others wonder why I responded to "Frank Slootweg" the way I did, they > first need to know he's a common troll who has infested Usenet for decades. I hope you like the pie and egg. [...]
[toc] | [prev] | [next] | [standalone]
| From | Maria Sophia <mariasophia@comprehension.com> |
|---|---|
| Date | 2026-08-28 14:49 -0600 |
| Message-ID | <116ss96$h39$1@nnrp.usenet.blueworldhosting.com> |
| In reply to | #195317 |
Frank Slootweg wrote:
>> If others wonder why I responded to "Frank Slootweg" the way I did, they
>> first need to know he's a common troll who has infested Usenet for decades.
>
> I hope you like the pie and egg.
Hi Frank,
Usenet, to me, is water under the bridge.
a. Treat me the way you want to be treated
b. And I respond, in kind
I have no qualms whatsoever for atoning for my sins as this isn't a game of
oneupmanship, but a sincere kind-hearted quest for solving hard problems.
So again, I easily and humbly and publicly apologize to you for not
appreciating that you were first who suggested that grep was, indeed,
inside the coreutils, which is critical since grep is very important.
That one revelation changes this entire public service announcement,
because all we're left with fixing are the commands NOT in the coreutils.
The sed seems to work, but the awk is a PITA due to the differences in how
Android, Windows & Linux handle single quotes, dollar signs & line feeds.
Overall, this PSA should have been about Microsoft CoreUtils & not WSL.
Since every post should add value, here's a catalogue of what it added.
File & Directory Operations:
cp, mv, rm, mkdir, rmdir, ls, ln, link, unlink, touch, pwd, basename,
dirname, realpath, readlink
Text Processing & Display:
cat, tac, head, tail, echo, printf, tee, wc, grep, sort, uniq, cut,
paste, join, comm, fold, fmt, tr, expand, unexpand, split, csplit, nl,
od, seq, shuf, ptx
Checksums & Formatting:
md5sum, sha1sum, sha224sum, sha256sum, sha384sum, sha512sum, b2sum,
cksum, sum, numfmt, factor, expr
Environment & System Info:
arch, nproc, uname, hostname, uptime, date, sleep, true, false, yes,
test, env, printenv, whoami, coreutils-manager
File Management & Attributes:
df, du, stat, truncate, mktemp, pathchk, install, find, xargs
Notably missing are apparently these, which WSL2CLI.bat might be used
to add as per the original PSA post, but only after testing them.
Text & Pattern Processing:
awk, sed
Archiving & Compression:
tar, gzip, gunzip, bzip2, zip, unzip
File Comparison & Patching:
diff, patch, cmp
Pagination:
less, more
Networking:
curl, wget, netcat, ssh
Shells & Scripting:
bash, sh
Here are some working examples of what we've been able to accomplish.
First, elevate the shell privileges and then check elevated-shell status
C:\> adb shell sh /storage/emulated/0/Android/data/moe.shizuku.privileged.api/start.sh
C:\> adb shell ps -A | grep -i shizuku
u0_a828 20618 901 6490828 151572 0 0 S moe.shizuku.privileged.api
shell 20817 1 5139096 88596 SyS_epoll_wait 0 S shizuku_server
Sort the shizuku processes by order of occurrence
C:\> adb shell ps -A | grep -i shizuku | sort -nk2
u0_a828 20618 901 6490828 148484 0 0 S moe.shizuku.privileged.api
shell 20817 1 5139096 88320 SyS_epoll_wait 0 S shizuku_server
Filter package names for shizuku
C:\> adb shell pm list packages | cut -d: -f2 | grep shiz
moe.shizuku.privileged.api
Count total packages that the user installed themslves
C:\> adb shell pm list packages | wc -l
1021
Check the battery level
C:\> adb shell dumpsys battery | awk '/level:/ {print "Battery Level:", $2 "%"}' | tr -d '\r'
Battery Level: 92%
Retrieve wi-fi ip addres
C:\> C:\app\editor\android\scrcpy> adb shell ip addr show wlan0 | awk '/inet / {print "IP Address:", $2}'
IP Address: 192.168.1.4/24
--
On Usenet, we pool our knowledge so everyone's a little smarter.
[toc] | [prev] | [next] | [standalone]
Page 1 of 6 [1] 2 3 4 5 6 Next page →
Back to top | Article view | alt.comp.os.windows-10
csiph-web