Re: "ifthen" for more "dynamic" argv manipulation

From: Laurent Bercot <ska-skaware_at_skarnet.org>
Date: Tue, 24 May 2016 19:22:41 +0200

On 24/05/2016 16:49, Max Ivanov wrote:
> another question in the spirit of this topic, why there is no command
> for a `backtick` + `import` combo? it is very common pattern, would be
> handy to have a shortcut, curious why execline doesn't have it?

  That was the default behaviour of backtick for a while, then I changed it
because it removed a lot of code duplication. Then I wrote withstdinas and
made backtick a trivial wrapper, for even less code. All of this was to
delete code and make the binaries as small as possible.

  But I agree that it has to be balanced against practicality, and that
backtick+import is very common. I'm also looking at your suggested changes
for backtick and coming to the conclusion that rewriting backtick as a real
binary instead of a wrapper around pipeline+withstdinas would be the cleanest
solution (else it's too intrusive in withstdinas). I can use the opportunity
to put the -E option back into backtick.

  It will only be a shortcut though; backtick won't do the substitution itself,
because I don't want to pull the substitution code into it again.
  Which means: "backtick -E VAR { stuff } prog" will still use the VAR
environment variable, but will execute into "import -u VAR prog"
instead of "prog".
  (technically, importas instead of import, in order to avoid unrelated,
tragick issues.)

-- 
  Laurent
Received on Tue May 24 2016 - 17:22:41 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:38:49 UTC