Globbing arguments to an external command
See original GitHub issueOne annoying difference between Windows’ old shell and the Unix shell is the lack of globbing on Windows. shx already addresses this for shell builtins and coreutils by including globbing logic in each of the commands’ implementations, but this still leaves external commands that weren’t written with Windows in mind (and thus don’t implement their own globbing) out in the cold.
Would you be open to a PR that adds a feature which simply globs all its arguments and runs the result?
For example, shx XXX foo *
would be equivalent to foo *
in a Unix shell.
As for naming, command
(like the bash builtin) might be an option. Or glob
. Or whatever; I’m not picky about the name.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:3
- Comments:12 (9 by maintainers)
Top Results From Across the Web
Shell command arguments, globbing and quoting
In general, a shell command specifies an executable (such as grep) followed by arguments to the command which are separated from each other ......
Read more >Can globbing be applied to multiple arguments in a command?
1. Yes, it's perfectly possible. You better give some details about what makes you think that would be a problem. – user313992. Feb...
Read more >Shell Wildcards and Globbing | Command Line Fundamentals
When the shell encounters a wildcard expression on the command line, it is internally expanded to all the files or pathnames that match...
Read more >Filename Globbing - Learning Red Hat Enterprise ... - O'Reilly
Before the shell passes arguments to an external command or interprets a built-in command, it scans the command line for certain special characters...
Read more >18.2. Globbing
Bash performs filename expansion on unquoted command-line arguments. The echo command demonstrates this. bash$ echo * a.1 b.1 c.1 t2.sh test1.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The reason I wanted exec to be on the blacklist is to nudge people toward running commands like
$ cmd -f arg
instead of$ shx exec cmd -f arg
. This keeps people away from all the exec nastiness, since there’s very little that it brings to the table for shx. There’s no technical reason it couldn’t be removed from the blacklist.Right now shelljs exec doesn’t actually perform any of its own globing, it still defers to the shell. We have been thinking of ways to rework exec to make it suit the community’s needs better.
I’ll have some time today, so I’ll try to write something up on the shelljs side and see if it’s worth pursuing.
Merging into #65 (the fix for both is to use
shell.cmd()
when it’s finished).