question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Globbing arguments to an external command

See original GitHub issue

One 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:closed
  • Created 7 years ago
  • Reactions:3
  • Comments:12 (9 by maintainers)

github_iconTop GitHub Comments

3reactions
nfischercommented, Jun 29, 2016

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.

0reactions
nfischercommented, Jul 4, 2018

Merging into #65 (the fix for both is to use shell.cmd() when it’s finished).

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found