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
signature.asc
Description: Digital signature