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]

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


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

The $HOME cases work; the ~ cases fail.

Presumably I'm doing something nefarious but I can't figure out what. Here's my ID's line from /etc/passwd:

lmaschm:unused:11232:10513:Lee Maschmeyer,U-CIT\lmaschm,S-1-5-21-583907252-436374069-725345543-1232:/home/lmaschm:/bin/bash



As far as I can tell I've done everything right, but I can't believe I've discovered a bug! I think I _am_ the bug. :-)



Thanks for any help,



--
Lee Maschmeyer
Wayne State University Computing Center
5925 Woodward, #281
Detroit MI 48202
USA

Attachment: cygcheck.out
Description: Binary data

--
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]