Repository navigation
Proposal: a dedicated "run in shell" step, with a configurable shell #42
Replies: 3 comments 2 replies
|
I think that instead of "run in shell" it should specify the shell "run in zsh", "run in bash", "run in pwsh" . It's more specific and it will not fail in strange cases where you fail to specify the shell. This way you don't have to analyze anything, you keep it verbatim and let the shell parse it (if I'm not mistaken in how it's done). |
Thank you for the interesting idea, moreover compliant with my policy "explicit in the step over argument in the command line`. But specifying the shell seems useful for very specific shell testing only. Within the Linux/Darwin/unix team, the shell syntax is largely shared, even for fish. The usual > < | & etc. are the same, and sh is everywhere, so that I don't see and added value in choosing the shell, till now. The only significative difference seems to be
This is why at this stage, I would lean towards not specifying the shell. But if you have any use case that do not fit, I would be happy to take it into account. |
|
Coming back to this proposal, with some progress made since the last messages — two points seem to be settling. First, the step keywords would be Second, on the shell choice. I keep my position that the step text should not bind a specific shell ( The reason is Windows: the invocation flag differs between the shells ( Hence the setting, as currently drafted: an enum, not a raw command line — For very specific needs, the plain The design notes are updated in |
Uh oh!
There was an error while loading. Please reload this page.
bbt runs commands without any shell: the arguments are split and unquoted by bbt itself, so pipes, redirections, and command substitutions are passed verbatim to the command, and a warning is raised on shell metacharacters in run steps (cf. the B115 feature).
Today, the workaround to get pipes, redirections or substitutions is to spawn a shell explicitly in the command, e.g.:
This works, but:
cut -d'\"';Proposal
When I run in shell "cmd1 | cmd2 > out"(with the usualsuccessfully runvariant), where bbt passes the whole command string as the single-cargument of a shell, without splitting it;--shell=<cmd>setting, overridable through aBBT_SHELLenvironment variable, defaulting to/bin/shon POSIX andcmd.exeon Windows;Open questions
cmd.exe /cand its quoting rules, or PowerShell??is not a wildcard in fish, command substitution is(...)instead of backticks or$(...), and quoting and escaping rules differ (no escape at all inside fish single quotes);The detailed proposal is
docs/proposed_features/run_in_shell.md, coming with the B115 follow-up on theptybranch.If you use bbt with pipes or redirections: how do you write those steps today, would a dedicated shell step help you, and which shell would you need (sh, bash, zsh, fish, PowerShell...)? Your feedback would help decide whether and how to implement it.
All reactions