[Top][All Lists]

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

Re: tilde character not interpreted in variable set

From: Chet Ramey
Subject: Re: tilde character not interpreted in variable set
Date: Fri, 2 Mar 2018 10:59:18 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

On 3/2/18 7:14 AM, Koncz, Istvan (Extern) wrote:

> Bash Version: 4.4
> Patch Level: 18
> Release Status: release
> Description:
> when i use ~/ for home folder it works in command line e.g. ls
> -la ~/.vimrc works, but when i add it to a variable e.g. foo="~/.vimrc"
> then ~/ will not be replaced to $HOME value like in command line, but i
> think it should be. ~ is a special character so must be escapped like
> \~ if i want the char, but without escape it should provide the home
> like in ls -la ~/ command. In my oppinion it is a bug.

It's not a bug. The tilde is quoted, and is not one of the special
characters that is interpreted inside double quotes.

``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    address@hidden    http://tiswww.cwru.edu/~chet/

reply via email to

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