Path: csiph.com!3.us.feeder.erje.net!feeder.erje.net!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail From: Ilkka Virta Newsgroups: gnu.bash.bug Subject: Re: Tilde expansion in assignment-like context Date: Tue, 7 Aug 2018 08:39:25 +0300 Lines: 28 Approved: bug-bash@gnu.org Message-ID: References: <349F67EA-6EA7-4C8E-8E3A-AC36A82EBFBD@gmail.com> <3f04a0db-0583-d5d9-1faf-75deb76c1219@case.edu> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: usenet.stanford.edu 1533620380 24004 208.118.235.17 (7 Aug 2018 05:39:40 GMT) X-Complaints-To: action@cs.stanford.edu To: chet.ramey@case.edu, Clint Hepner , bug-bash@gnu.org Envelope-to: bug-bash@gnu.org User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 In-Reply-To: <3f04a0db-0583-d5d9-1faf-75deb76c1219@case.edu> Content-Language: en-US X-SASI-RCODE: 200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; h=subject:to:references:from:message-id:date:mime-version:in-reply-to:content-type:content-transfer-encoding; s=smtp; bh=SeHr8Q6LikmKo3lcIeFFNGWVe6zoo9YLMmiJrJ6UgYM=; b=KpNa85J7xD8VDRcYt6ZsUNwMccbZR58VH3hTTCucsJg9oQEVRzgm3cHSpizJm936+Uhu2ON3ywPgz/2PI2Nwg5WmWoUgjvWx28Vb1hd3As/kaH6VGuhXNv7QHc0BIKeRsbRm+b1RJnogoERGh9/65skjaI/+0yI0AYqT29GBQ3IChW8oqSRqYNNB2TLkNx1v3uKIMuWeX3gY4XVE7b3SseVENfKOB9OZzFZ1mg60dhBbpDxojqNL60N8AzK8qfBkUC16WbU2D6n6ezdEsgrHi9wxUVaVXCMT3R/BueIqJZywm9gxmQskc4tcdxnTcy1madH2SiOe2v+efHVYiWgTIw== X-detected-operating-system: by eggs.gnu.org: FreeBSD 8.x [fuzzy] X-Received-From: 157.24.2.213 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com gnu.bash.bug:14459 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