On 6.8. 22:45, Chet Ramey wrote:
Yes. Bash has done this since its earliest days. A word that looks like an
assignment statement has tilde expansion performed after unquoted =~ and :~
no matter where it appears on the command line.
Given that options starting with a double-dashes (--something=/some/dir)
are rather common, would it make sense to extend tilde expansion to
apply in that case too?
Of course, getopt_long() supports giving the option argument in a
separate command-line argument, so you can work around it with that.
Also, does the documentation actually say tilde expansion applies in
anything that looks like an assignment? I can only see "If a word begins
with an unquoted tilde character..." and "Each variable assignment is
checked for unquoted tilde-prefixes...", but from the shell language
point of view, the one in 'make DESTDIR=~stager/bash-install' isn't an
assignment, just a regular command line argument.
The paragraph about assignments could be expanded to say "This applies
also to regular command-line arguments that look like assignments." or
something like that.
--
Ilkka Virta / itvi...@iki.fi