bug-bash
[Top][All Lists]
Advanced

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

Tilde expansion in assignment-like context


From: Clint Hepner
Subject: Tilde expansion in assignment-like context
Date: Mon, 6 Aug 2018 15:09:59 -0400

Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: darwin16.7.0
Compiler: clang
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='d\
arwin16.7.0' -DCONF_MACHTYPE='x86_64-apple-darwin16.7.0' -DCONF_VENDOR='apple' \
-DLOCALEDIR='/usr/local/Cellar/bash/4.4.19/share/locale' -DPACKAGE='bash' -DSHE\
LL -DHAVE_CONFIG_H -DMACOSX   -I.  -I. -I./include -I./lib -I./lib/intl -I/priv\
ate/tmp/bash-20180209-55597-111ek7c/bash-4.4/lib/intl  -DSSH_SOURCE_BASHRC -Wno\
-parentheses -Wno-format-security
uname output: Darwin hemma.local 16.7.0 Darwin Kernel Version 16.7.0: Thu Jun 2\
1 20:07:39 PDT 2018; root:xnu-3789.73.14~1/RELEASE_X86_64 x86_64
Machine Type: x86_64-apple-darwin16.7.0

Bash Version: 4.4
Patch Level: 19
Release Status: release

Description:
        A non-initial unquoted tilde is expanded outside of an assignment. This
        was raised as a question on Stack Overflow, 
https://stackoverflow.com/q/51713759/1126841.

Repeat-By:
        
        $ set +k
        $ echo home_dir=~
        home_dir=/Users/chepner

A similar string that does not start with a valid identifier leaves the tilde 
unexpanded.

        $ echo --home_dir=~
        --home_dir=~

The behavior is also present in commit 
057a9fbdb4d9ad01b000743fcea9918b80823afc, bash-20180803 snapshot.


Fix:
        [Description of how to fix the problem.  If you don't know a
        fix for the problem, don't include this section.]


reply via email to

[Prev in Thread] Current Thread [Next in Thread]