Re: -a $HOME/.bashrc and -a ~/.bashrc produce different results

2011-05-20 Thread Csaba Raduly
On Thu, May 19, 2011 at 11:06 PM, Eric Blake wrote: > "$HOME" expands $HOME, but "~/.bashrc" does _not_ expand ~.  For > tilde-expansion to occur, it must be unquoted. Not only that, it has to be the first character: 3.5.2 Tilde Expansion - If a word begins with an unquoted

Re: -a $HOME/.bashrc and -a ~/.bashrc produce different results

2011-05-19 Thread Eric Blake
On 05/19/2011 02:54 PM, Lee Maschmeyer wrote: > Hi all, > > For most uses, $HOME and ~ produce identical results. For example, ls > $HOME or ls ~ are the same. But the following script fails: > > Presumably I'm doing something nefarious but I can't figure out what. I can. And it's not cygwin-sp

Re: -a $HOME/.bashrc and -a ~/.bashrc produce different results

2011-05-19 Thread Illia Bobyr
On 5/19/2011 3:54 PM, Lee Maschmeyer wrote: > > Hi all, > > For most uses, $HOME and ~ produce identical results. For example, ls > $HOME > or ls ~ are the same. But the following script fails: > > #!/bin/bash > > for i in "$HOME/.bashrc" "~/.bashrc" ; do > echo $i > if [ -a "$i" ]; then >