Re: Search Path in bash2

2004-02-29 Thread Martin McCormick
I am quoting one response I received, but my thanks to
everyone who answered.  I went to the system in question and figured I
would methodically try every suggestion I received until I either
exhausted all possibilities or something worked.

I was hoping for a global solution that would not require
modifying each user's .bash_profile, and it turns out that
/etc/profile appears to do the trick.  After one false start of
setting $path instead of $PATH, I added the following line which I
have broken for readability:

PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:
/usr/local/bin:/usr/local/etc:/usr/X11R6/bin:~/bin

This appears to correctly modify the behavior in the desired
manner.

Again, many thanks to all who answered.

Martin McCormick WB5AGZ  Stillwater, OK 
OSU Information Technology Division Network Operations Group
Peter Risdon writes:
When  bash is invoked as an interactive login shell, or as a non-inter-
   active shell with the --login option, it first reads and 
executes  com-
   mands  from  the file /etc/profile, if that file exists.  After 
reading
   that file, it looks for ~/.bash_profile, ~/.bash_login, and 
~/.profile,
   in  that order, and reads and executes commands from the first 
one that
   exists and is readable.  The --noprofile option may be  used  
when  the
   shell is started to inhibit this behavior.
 
But so far as I have seen, at least on FreeBSD, /etc/profile does not 
generally contain path info. This is normally set in ~/.profile and the 
default contains something like this:

# remove /usr/games and /usr/X11R6/bin if you want
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/
usr/X11R6/
bin:$HOME/bin; export PATH

So my guess is that to conform closely to this way of doing things, add 
the path to each user's ~/.profile and also to 
/usr/share/skel/dot.profile so it is there immediately for new users.

Alternatively, unless someone contradicts this, the man page seems to 
suggest you could add a path to /etc/profile and it would then be 
system-wide. I have never done this myself, though, so can't vouch for 
it whereas I have edited ~/.profile frequently.

HTH.

PWR.



___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Search Path in bash2

2004-02-28 Thread Scott W
Peter Risdon wrote:

Martin McCormick wrote:

I am trying to modify the execution path on a FreeBSD system
for all the bash2 users on that system.  The man page says that
 

  default path is system-dependent, and is set by the
  administrator who installs bash.A common value is
  ``/usr/gnu/bin:/usr/local/bin:/usr/ucb:/bin:/usr/bin:.''.
  


How do I set, or in this case, reset it?  

The man page also says:

When  bash is invoked as an interactive login shell, or as a non-inter-
  active shell with the --login option, it first reads and 
executes  com-
  mands  from  the file /etc/profile, if that file exists.  After 
reading
  that file, it looks for ~/.bash_profile, ~/.bash_login, and 
~/.profile,
  in  that order, and reads and executes commands from the first 
one that
  exists and is readable.  The --noprofile option may be  used  
when  the
  shell is started to inhibit this behavior.

But so far as I have seen, at least on FreeBSD, /etc/profile does not 
generally contain path info. This is normally set in ~/.profile and 
the default contains something like this:

# remove /usr/games and /usr/X11R6/bin if you want
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/usr/X11R6/ 

bin:$HOME/bin; export PATH

So my guess is that to conform closely to this way of doing things, 
add the path to each user's ~/.profile and also to 
/usr/share/skel/dot.profile so it is there immediately for new users.

Alternatively, unless someone contradicts this, the man page seems to 
suggest you could add a path to /etc/profile and it would then be 
system-wide. I have never done this myself, though, so can't vouch for 
it whereas I have edited ~/.profile frequently.

HTH.

PWR.



___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to 
[EMAIL PROTECTED]

You can add any environment vars you'd like to /etc/profile- this is 
still the preferred method for some cases...for example, if you're the 
sysadmin for a project group that all needs additional software that may 
have been installed in the /usr/local/somewhere/bin tree, instead of 
binaries in /usr/local/bin.  So if it's assumed that all users will need 
a given PATH, add it to /etc/profile.  If it's a per user addition, add 
it in ~/.bash_profile..

There are a mixture of other ways to do this, with the 'new thing' being 
application dependent env vars (LD_LIBRARY_PATH, PATH, etc)- in Linux, 
this is generally done via /etc/profile.d/appname.sh, but is not 
generally used for correcting user-owned variables.  So in other words, 
/etc/profile is fine ;-)

Scott

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Search Path in bash2

2004-02-27 Thread Martin McCormick
I am trying to modify the execution path on a FreeBSD system
for all the bash2 users on that system.  The man page says that 

 default path is system-dependent, and is set by the
 administrator who installs bash.  A common value is
 ``/usr/gnu/bin:/usr/local/bin:/usr/ucb:/bin:/usr/bin:.''.

How do I set, or in this case, reset it?  There are a number
of profiles and configuration files that look like they might work
such as login.conf, but I see no change in the $PATH I get and I
didn't run across anything in the port of bash that seemed to set a
path.

The path I do get is perfectly good, but I also want users to
get a shot at /usr/local/etc which isn't in the default path.

Thanks a lot.  I almost think I am loosing my magic touch.  I
can't find the global PATH setter for bash2 anywhere.

Martin McCormick WB5AGZ  Stillwater, OK 
OSU Information Technology Division Network Operations Group
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Search Path in bash2

2004-02-27 Thread Peter Risdon
Martin McCormick wrote:

	I am trying to modify the execution path on a FreeBSD system
for all the bash2 users on that system.  The man page says that 

 

	  default path is system-dependent, and is set by the
	  administrator who installs bash.	A common value is
	  ``/usr/gnu/bin:/usr/local/bin:/usr/ucb:/bin:/usr/bin:.''.
   

	How do I set, or in this case, reset it? 
 

The man page also says:

When  bash is invoked as an interactive login shell, or as a non-inter-
  active shell with the --login option, it first reads and 
executes  com-
  mands  from  the file /etc/profile, if that file exists.  After 
reading
  that file, it looks for ~/.bash_profile, ~/.bash_login, and 
~/.profile,
  in  that order, and reads and executes commands from the first 
one that
  exists and is readable.  The --noprofile option may be  used  
when  the
  shell is started to inhibit this behavior.

But so far as I have seen, at least on FreeBSD, /etc/profile does not 
generally contain path info. This is normally set in ~/.profile and the 
default contains something like this:

# remove /usr/games and /usr/X11R6/bin if you want
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/usr/X11R6/
bin:$HOME/bin; export PATH
So my guess is that to conform closely to this way of doing things, add 
the path to each user's ~/.profile and also to 
/usr/share/skel/dot.profile so it is there immediately for new users.

Alternatively, unless someone contradicts this, the man page seems to 
suggest you could add a path to /etc/profile and it would then be 
system-wide. I have never done this myself, though, so can't vouch for 
it whereas I have edited ~/.profile frequently.

HTH.

PWR.



___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]