adding to $PATH
I just want to add cwd to path for all users. in my /etc/profile, I've pasted the portions involving the paths; however, adding the current dir or anything to default path and non-root users path still doesn't show up in path for all users. Yes I didn't forget to execute /etc/profile after editing it. :scratch:
# Set the default system $PATH: PATH="/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games" # For root users, ensure that /usr/local/sbin, /usr/sbin, and /sbin are in # the $PATH. Some means of connection don't add these by default (sshd comes # to mind). if [ "`id -u`" = "0" ]; then echo $PATH | grep /usr/local/sbin 1> /dev/null 2> /dev/null if [ ! $? = 0 ]; then PATH=/usr/local/sbin:/usr/sbin:/sbin:$PATH fi fi # For non-root users, add the current directory to the search path: if [ ! "`id -u`" = "0" ]; then PATH="$PATH:." fi |
You adding a path cwd to PATH, or you want to add the Change Working Directory command?
|
current directory
|
Re: adding to $PATH
Thats not something you should add to path. The current directory should be considered by anything using path anyway.
OR Just because you can add ./ (Dot Slash). as in PATH="/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:./" But that shouldn't be necessary. |
Code:
if [ "`id -u`" = "0" ]; then {edit} 'man bash' there's a default location for these kind's of thing's. |
That didn't work either. Plus that section is for root, and I want to add the path for all users on my system.
My point is that I should be able to do something as simple as adding to the path without any problems in slack, regardless of what I'm adding. |
Don't get down on slackware...there's power to be had in text file's.
If you want to add the current working directory for all user's... do 'true' ('man true') it's already that way. :) take note that 'man bash', there's a default location for these file's, i believe it's bash.rc or .bashrc. |
It *is* the default, or it's supposed to be - the end of /etc/profile should read similarly to Tarts' quote - and Tarts' and this are not for root:
Code:
# For non-root users, add the current directory to the search path: |
Quote:
{edit} when i say my executable's dir. i mean my own executable's, the one's i make myself. |
You can resource the /etc/profile by
. /etc/profile |
Add "." in the PATH is considered to be high risk of TrojanHorse.
Supposed some user on ur network or even an intruder is able to access certain location on ur sourceTree, maybe /var/ftp/incoming and put a shell script as "ls" with content "rm -rf /". That mean u ll need an new install after calling "ls" in that directory .. That is why it is always recomended not to include "." in the PATH enviroment at all, that is why ppl must do "./configure" even if they are in the dir containing the configure script .. of any packaged they may have tried to install .. |
Hm. I'm misreading all over the place. Well, the /etc/profile thing should work for users, anyway. Oof.
But go ahead and argue with me. :) I argue with conventional wisdom all I can but *nix permissions still utterly mystify me so I was just repeating what I understood as conventional wisdom there. :) |
Quote:
|
This is just for practical purposes, and I just wanted to add it to all users system wide.
Yes, digiot, it's searched in order of listing. |
And not-reading all over the place. I missed your profile tip the first time around. Thanks.
Yeah - so I still don't get the paths and permissions things. *sigh* I think that's the thing that gives me the most headaches. |
All times are GMT -5. The time now is 06:28 AM. |