delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/05/19/17:00:27

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00
X-Spam-Check-By: sourceware.org
X-ASG-Debug-ID: 1305838804-4b6dab790001-w5GHUG
X-Barracuda-Envelope-From: Illia DOT Bobyr AT ronin-capital DOT com
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
X-ASG-Orig-Subj: Re: -a $HOME/.bashrc and -a ~/.bashrc produce different results
Subject: Re: -a $HOME/.bashrc and -a ~/.bashrc produce different results
Message-ID: <4DD584BE.6040003@ronin-capital.com>
References: <19A81F46A6B94CCE9372358896F3E86B AT cit DOT wayne DOT edu>
In-Reply-To: <19A81F46A6B94CCE9372358896F3E86B@cit.wayne.edu>
user-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.17) Gecko/20110414 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.10
MIME-Version: 1.0
X-Barracuda-Connect: UNKNOWN[10.106.240.21]
X-Barracuda-Start-Time: 1305838804
X-Barracuda-Encrypted: AES128-SHA
X-Barracuda-URL: http://spam01.roncap.com:8000/cgi-mod/mark.cgi
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On 5/19/2011 3:54 PM, Lee Maschmeyer wrote:
>
> Hi all,
>
> For most uses, $HOME and ~ produce identical results. For example, ls=20
> $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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019