This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: -a $HOME/.bashrc and -a ~/.bashrc produce different results
- From: Illia Bobyr <Illia dot Bobyr at ronin-capital dot com>
- To: "cygwin at cygwin dot com" <cygwin at cygwin dot com>
- Date: Thu, 19 May 2011 15:59:42 -0500
- Subject: Re: -a $HOME/.bashrc and -a ~/.bashrc produce different results
- References: <19A81F46A6B94CCE9372358896F3E86B@cit.wayne.edu>
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