bug-bash
[Top][All Lists]
Advanced

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

Re: invoke tilde expansion on quoted string


From: Yang Chengwei
Subject: Re: invoke tilde expansion on quoted string
Date: Sun, 11 Dec 2011 16:28:49 +0800
User-agent: Mutt/1.5.20 (2009-06-14)

On Sat, Nov 12, 2011 at 01:42:16PM +0800, Peng Yu wrote:
> Hi,
> 
> I know from the document that tilde expansion only works if the string
> is unquoted (see below)
> 
> ~$ cd '~/..'
> -bash: cd: ~/..: No such file or directory
> ~$ cd ~/..
> /Users$
> 
> I'm wondering if I already have a string variable, is there a bash
> native to do tilde expansion on it.
> 
> var='~/..'
> cd $var#how to change this line?
If you just want to tilde expansion, how about let it unquoted? Just
like below.

var=~chengwei/Dir
cd $var

--
Thanks,
Chengwei
> 
> -- 
> Regards,
> Peng

Attachment: signature.asc
Description: Digital signature


reply via email to

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