Glob expanding: Windows vs Unix vs PowerShell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SETLOCAL ENABLEDELAYEDEXPANSION | |
SET FILES= | |
FOR %%A IN (%1\*.gz) DO ( SET FILES=!FILES! %%A ) | |
echo !FILES! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo (gci d:\Temp\*.zip | % { "$_" }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bash | |
echo $1/*.gz |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Your PowerShell glob can be simplified slightly: