Skip to content

File wildcard/glob patterns in Windows eza #621

Discussion options

You must be logged in to vote

OK, I apologize for my brain freeze. When I write code in Windows, I forget that the .net file functions typically do the glob expansion and that in the rest of the world it tends to be the shell handling this need.

I created a small .cmd file named glob.cmd:

@echo off
set expanded_list=
for /f "tokens=*" %%F in ('dir /b /a:-d "%~1"') do call set expanded_list=%%expanded_list%% "%%F"

echo expanded_list is:
echo %expanded_list%

If I run my glob.cmd as: glob.cmd w*.*
and then run: eza -lhag %expanded_list%
it works as expected. It's not a complete solutions and it doesn't handle recursive globbing, but that can also be resolved. So, because of limitations in Windows, this is not as conven…

Replies: 2 comments 15 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by TxAggie87
Comment options

You must be logged in to vote
15 replies
@per11235813
Comment options

@daviessm
Comment options

@eggbean
Comment options

@daviessm
Comment options

@NikitaRevenco
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants