1.7.7: PATH in Bash shells
Gerry Reno
greno@verizon.net
Sun Feb 6 20:43:00 GMT 2011
David, thanks for the response. I put my responses inline...
On 02/06/2011 02:16 PM, David Sastre wrote:
> On Sun, Feb 06, 2011 at 01:33:37PM -0500, Gerry Reno wrote:
>
>> What is the proper method to set the PATH variable on a system-wide
>> basis in Cygwin?
>>
>> Right now in the Cygwin Bash shell the PATH is set to:
>>
>> bash-4.1$ echo $PATH
>> /cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/System32/Wb
>> em:/cygdrive/c/Program Files (x86)/Microsoft SQL
>> Server/90/Tools/binn/:/usr/bin
>>
> First off, I'm curious about how do you start the bash shell. I ask
> because you don't seem to have PS1 set correctly, and that should be
> automated by startup-scripts.
>
I didn't change anything. This is rather new installation of Cygwin.
I have seen some postinstall script failures on a few packages but would
these be modifying the system-wide PATH variable?
>
>
>> I think what I need is for the system-wide PATH to look something like this:
>>
>> /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/System32/Wbem:/cygdrive/c/Program
>> Files (x86)/Microsoft SQL Server/90/Tools/binn/
>>
> And that's how it should look like. The fact that you have cygwin's
> paths *after* windows paths in your PATH is something you probably have
> modified by hand.
>
Nope. Haven't changed anything about the PATH.
In a new Cygwin Bash shell:
bash-4.1$ cd ~
bash-4.1$ grep -ERHn "PATH *=" * .* --exclude-dir=".*"
cygcheck.txt:24:HOMEPATH = '\Documents and Settings\Administrator'
.bash_profile:29:# PATH=${HOME}/bin:${PATH}
.bash_profile:34:# MANPATH=${HOME}/man:${MANPATH}
.bash_profile:39:# INFOPATH=${HOME}/info:${INFOPATH}
bash-4.1$
bash-4.1$ cd /etc
bash-4.1$ grep -ERHn "PATH *=" * .* --exclude-dir=".*"
defaults/etc/profile:31:PATH=/usr/local/bin:/usr/bin:/bin:$PATH
defaults/etc/profile:34:MANPATH=/usr/local/man:/usr/share/man:/usr/man:$MANPATH
defaults/etc/profile:37:INFOPATH=/usr/local/info:/usr/share/info:/usr/info:$INFO
PATH
defaults/etc/skel/.bash_profile:29:# PATH=${HOME}/bin:${PATH}
defaults/etc/skel/.bash_profile:34:# MANPATH=${HOME}/man:${MANPATH}
defaults/etc/skel/.bash_profile:39:# INFOPATH=${HOME}/info:${INFOPATH}
defaults/etc/sshd_config:6:# This sshd was compiled with
PATH=/bin:/usr/sbin:/sb
in:/usr/bin
postinstall/000-cygwin-post-install.sh.done:11:export PATH="/bin:$PATH"
postinstall/colorgcc.sh.done:5:PATH=/bin:/sbin:/usr/bin:/usr/sbin
postinstall/rsnapshot.sh.done:5:PATH=/bin:/sbin:/usr/bin:/usr/sbin
profile:32:PATH=/usr/local/bin:/usr/bin:/bin:$PATH
profile:35:MANPATH=/usr/local/man:/usr/share/man:/usr/man:$MANPATH
profile:38:INFOPATH=/usr/local/info:/usr/share/info:/usr/info:$INFOPATH
profile.d/lapack0.sh:14: export PATH="${PATH}:${LA_BINDIR}"
profile.d/lapack0.sh:18: export PATH="${LA_BINDIR}"
profile.d/openssl.sh:1:export MANPATH="${MANPATH}:/usr/ssl/man"
rc.d/init.d/postgresql:12:PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sb
in:/usr/bin
skel/.bash_profile:29:# PATH=${HOME}/bin:${PATH}
skel/.bash_profile:34:# MANPATH=${HOME}/man:${MANPATH}
skel/.bash_profile:39:# INFOPATH=${HOME}/info:${INFOPATH}
sshd_config:6:# This sshd was compiled with
PATH=/bin:/usr/sbin:/sbin:/usr/bin
bash-4.1$
bash-4.1$ cat /Cygwin.bat
@echo off
C:
chdir C:\cygwin\bin
REM bash --verbose --login -i
bash -i
pause
bash-4.1$
I have not changed anything about PATH anywhere.
>
>
>> Is the PATH setting I'm looking for workable with Cygwin?
>>
> The PATH variable in cygwin is exported from your /etc/profile
> file, which contains a line that sets cygwin's path with higher
> precedence over the PATH inherited from windows.
>
Yep, I see it. So why isn't it working?
>
>> Or do the Windows paths need to come first for some reason?
>>
> Quite the opposite.
>
That's what I thought.
>
>> Is there some guiding document about setting PATH system-wide to better
>> support scripts from Linux?
>>
>
> Yes. The info you need is in the bash manpage, INVOCATION section.
>
>
bash-4.1$ man bash
(END)
No man pages.
How do you get the man page generated?
And here's the tail end of /var/log/setup.log.full:
2011/02/06 12:01:40 running: C:\cygwin\bin\bash.exe --norc
--noprofile /etc/post
install/coreutils.sh
2011/02/06 12:01:41 abnormal exit: exit code=128
2011/02/06 12:01:41 running: C:\cygwin\bin\bash.exe --norc
--noprofile /etc/post
install/bash.sh
2011/02/06 12:01:41 abnormal exit: exit code=128
2011/02/06 12:01:41 running: C:\cygwin\bin\bash.exe --norc
--noprofile /etc/post
install/update-info-dir.sh
2011/02/06 12:02:24 running: C:\cygwin\bin\bash.exe --norc
--noprofile /etc/post
install/libglade2.0.sh
could not open /etc/xml/catalog for saving
add command failed
2011/02/06 12:02:25 abnormal exit: exit code=2
2011/02/06 12:02:25 Changing gid to Administrators
2011/02/06 12:03:00 note: Installation Complete
2011/02/06 12:03:00 Ending cygwin install
Regards,
Gerry
--
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
More information about the Cygwin
mailing list