[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-bash] No tilde expansion in [[..]] when reading input with read
From: |
Suvayu Ali |
Subject: |
[Help-bash] No tilde expansion in [[..]] when reading input with read |
Date: |
Mon, 25 Feb 2013 00:03:48 +0100 |
User-agent: |
Mutt/1.5.21 (2012-12-30) |
Hi,
I'm trying to read in a directory name with read, later when I test it
with [[ -d $mydir ]] it fails if there is a tilde. I'm guessing tilde
expansion is not happening in [[...]]. I have attached a test script
which demonstrates my issue.
$ ./test.bash
Enter directory: ~/
~/ does not exist
Can someone help me understand what is going wrong here?
Thanks a lot,
--
Suvayu
Open source is the future. It sets us free.
test.bash
Description: Text document