Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #14459 > unrolled thread

Re: Tilde expansion in assignment-like context

Started byIlkka Virta <itvirta@iki.fi>
First post2018-08-07 08:39 +0300
Last post2018-08-07 08:39 +0300
Articles 1 — 1 participant

Back to article view | Back to gnu.bash.bug

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Tilde expansion in assignment-like context Ilkka Virta <itvirta@iki.fi> - 2018-08-07 08:39 +0300

#14459 — Re: Tilde expansion in assignment-like context

FromIlkka Virta <itvirta@iki.fi>
Date2018-08-07 08:39 +0300
SubjectRe: Tilde expansion in assignment-like context
Message-ID<mailman.4786.1533620380.1292.bug-bash@gnu.org>
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 / itvirta@iki.fi

[toc] | [standalone]


Back to top | Article view | gnu.bash.bug


csiph-web