4 ms·
You can, but sometimes the quoting rules differ. For example, bcdedit with its {}-delimited GUIDs breaks in PowerShell without additional quoting, but works fi
by sveiss 10y ago
You can, but sometimes the quoting rules differ.
For example, bcdedit with its {}-delimited GUIDs breaks in PowerShell without additional quoting, but works fine in cmd.exe. Makes following online instructions tricky if you're not familiar with that nuance.
- ygra 10y agoWell, the nice thing in PowerShell is that you have explicit control over "stop parsing here and just pass the rest to the application verbatim" with --%. Solves a lot of quoting nightmares.
- LeonidasXIV 10y agoThat's indeed nice. I wonder if there is something like that for ZSH.
- dylanfw 10y agoI don't know for sure about ZSH and can't test it at the moment, but Bash has -- for this purpose. It may work in ZSH as well.
- ygra 10y agoIsn't the -- a feature of the command to stop option parsing and treat the remaining arguments as file names? AFAIK it's not a shell feature that solves quoting (and it's not that easy on Unix either, since running a program involves argument parsing instead of just passing a string).
- Sean1708 10y agoYou could define `--` as "perform no expansions for the rest of the line", then you wouldn't have to worry about globs or `{}` which is where most of my annoyances come from. BTW `--` isn't treated specially in version 4 of Bash.
- voltagex_ 10y agoHow come none of the tutorials I've read and StackOverflow questions involving Start-Process mention that? Thanks.
- ygra 10y agoWell, it won't work with Start-Process, and it's also buried deep in the documentation and impossible to google. I constantly forget about the exact character sequence, too.