This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: "which" command does not expand "~" in path
- From: Sven Köhler <skoehler at upb dot de>
- To: cygwin at cygwin dot com
- Date: Sat, 25 Sep 2004 20:32:31 +0200
- Subject: Re: "which" command does not expand "~" in path
- References: <1094385246.5803.ezmlm@cygwin.com> <6.1.2.0.1.20040926005459.02810cb0@mail.ros.com.au>
Set PATH so it includes user's private bin if it exists
if [ -d ~/bin ] ; then
PATH="~/bin:${PATH}"
fi
Hmm, i'm not 100% percent sure, but is this supposed to work in general?
I don't think that all programs that use the PATH varible are supposed
to interpret ~ correctly.
Instead, the shell usually substitutes ~ or ~user.
Look at this the output of these commands:
echo ~
echo "~"
I would suggest to use
PATH="$HOME/bin:$PATH"
or even
PATH="$(echo -n ~)/bin:$PATH"
instead of your line.
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/