Re: [execline] Conditional export

From: Laurent Bercot <ska-skaware_at_skarnet.org>
Date: Thu, 23 Mar 2023 15:19:21 +0000

  I'm going to regret this.

ifthenelse -s { eltest -f ${FILE} } { export EXISTS ${FILE} } { }
env

  This construct is purposefully not documented, because it breaks
syntactic and logic assumptions that are true in the rest of execline.
But it can simplify your life in a handful of cases, like this one.

  What it does: it will *prepend the rest of your script* with the
contents of the second or the third block, depending on whether the
test in the first block is true.

  Do not overuse it. Do not ask for support about it. If it makes your
script easier to maintain, enjoy. If you start feeling like a sorcerer
and are tempted to explore what kind of magical feats you can accomplish
with it, don't - it will not end well.

--
  Laurent
Received on Thu Mar 23 2023 - 16:19:21 CET

This archive was generated by hypermail 2.4.0 : Thu Mar 23 2023 - 16:19:50 CET