This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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
>  echo "-a worked"
>     else
>  echo "-a didn't work"
>     fi
>
>     if [ -e "$i" ]; then
>  echo "-e worked"
>     else
>  echo "-e didn't work"
>     fi
> done
>

Here is what I see on my box:

$ ./1.sh
/home/ibobyr/.bashrc
-a worked
-e worked
~/.bashrc
-a didn't work
-e didn't work

I guess the output on your box might be helpful in diagnosing the issue.

Ilya Bobyr

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]