delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/02/06/14:16:34

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,T_TO_NO_BRKTS_FREEMAIL
X-Spam-Check-By: sourceware.org
Date: Sun, 6 Feb 2011 20:16:19 +0100
From: David Sastre <d DOT sastre DOT medina AT gmail DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: 1.7.7: PATH in Bash shells
Message-ID: <20110206191619.GA6839@jethro.local.lan>
References: <4D4EE981 DOT 4060309 AT verizon DOT net>
MIME-Version: 1.0
In-Reply-To: <4D4EE981.4060309@verizon.net>
User-Agent: Mutt/1.5.20 (2009-06-14)
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT 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

--sdtB3X0nJg68CQEu
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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?
>=20
> Right now in the Cygwin Bash shell the PATH is set to:
>=20
>     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.=20
=20
> I think what I need is for the system-wide PATH to look something like th=
is:
>=20
>     /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/cygdriv=
e/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.
=20
> Is the PATH setting I'm looking for workable with Cygwin?=20

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.

> Or do the Windows paths need to come first for some reason?

Quite the opposite.

> Is there some guiding document about setting PATH system-wide to better
> support scripts from Linux?
=20
Yes. The info you need is in the bash manpage, INVOCATION section.

--=20
Huella de clave primaria: 0FDA C36F F110 54F4 D42B  D0EB 617D 396C 448B 31EB

--sdtB3X0nJg68CQEu
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAk1O84MACgkQYX05bESLMeta5ACgy2ZyZt2kM7VfRgXNAgSKbwyU
8RAAoJ9xWRYpB8q3zwP8QPXXmXrA8gOc
=v/e+
-----END PGP SIGNATURE-----

--sdtB3X0nJg68CQEu--

- Raw text -


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