Ilya Zakharevich on Wed, 18 Sep 2024 09:57:17 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Missing features in strexpand()


It seems that the following (backward-compatible) aspects are not
supported now:

  • $$ for the pid
  • $< (maybe better $0 — but not backward-compatible) for the
    currently executed script taken from ARGV.
  • $<< for same as above, or the currently evaluated read() script.
  • $. (if this info is stored anywhere) the current line number
    inside $<.
  • $.. same inside $<<.
  • $<<< the innermost evaluated line (as a string).

Moreover, if --args was used on the command line:

  • $# number of arguments after "--args".
  • $1 the first argument  after "--args".  Etc.

Also allow --eval on the command line, with the following argument
processed “as if read from STDIN” (so $< is "-" during the evaluation
etc.).

Here --eval arguments are read in the same order as the loaded
scripts, but --args should be processed BEFORE the loaded
scripts — and/or --eval⸣s.  (Since they are at end of the command line.)

Thanks,
Ilya