Re: .profile BASH in PATH?
Pollywog wrote: You could make a directory $HOME/bin and put your shell scripts there, and also add it to your PATH in your user .profile: PATH=$PATH:/home/username/bin export PATH That would be better than just adding . to your PATH. even better might be using $HOME rather than /home/username, since $HOME is set already and homedir sometimes change. PATH=$PATH:$HOME/bin (assumuing bash for login shell, others similar) but that's turning out kind'a academic talk... ;-) gerhard
.profile BASH in PATH?
Hi, I have 2 perhaps simple questions: 1. The only user on my system who has a ~/.profile is root. It had to have been generated during installation. So I am left to wonder, how do I create a ~/.profile for each user as well as subsequent users. 2. Also, when I want execute a shell script, why am I forced to do... bash shell.script Is this related to my PATH configurations? Sorry if these seem like banal questions but I am still a newbie. Thanks, bwarsing
Re: .profile BASH in PATH?
On Sun, Sep 12, 1999 at 08:12:18PM -0700, bwarsing wrote: Hi, I have 2 perhaps simple questions: 1. The only user on my system who has a ~/.profile is root. It had to have been generated during installation. So I am left to wonder, how do I create a ~/.profile for each user as well as subsequent users. For current users, I think the answer is copy it over by hand. For new users, place the files you want to becopied into their homedir into /etc/skel 2. Also, when I want execute a shell script, why am I forced to do... bash shell.script Now this isn't fun. Check that the first line of the shell script reads something like: #!/bin/bash -or- #!/bin/sh Without this line, things go broke. Hmm. After a moment's thought, it occured to me that perchance the script file is not +x -- run the appropriate chmod command on the script to make it executable. I, being thick-headed and hard to change, would type: chmod 755 script if it was OK for others to run it, or chmod 744 script if it was not OK for them to run it, but seeing it was still fine, or chmod 500 script if I trusted neither them nor myself. :) If you aren't as thickheaded as I am, you will probably use the nice letters instead of numbers. (can find them in man chmod) Is this related to my PATH configurations? Probably not. Check your .bashrc and .bash_profile files all the same -- look for something that sets PATH without using the old value too. But, again, it shouldn't affect shell scripts. -- Seth Arnold | http://www.willamette.edu/~sarnold/ Hate spam? See http://maps.vix.com/rbl/ for help Hi! I'm a .signature virus! Copy me into your ~/.signature to help me spread!
Re: .profile BASH in PATH?
On Sun, Sep 12, 1999 at 08:12:18PM -0700, bwarsing wrote: 1. The only user on my system who has a ~/.profile is root. It had to have been generated during installation. So I am left to wonder, how do I create a ~/.profile for each user as well as subsequent users. If you are using bash each user has .bashrc and .bash_profile in his home directory. The only profile I know is /etc/profile. 2. Also, when I want execute a shell script, why am I forced to do... bash shell.script Put #!/bin/bash in the first line of your script. Greetings. -- -- _ ___ Marcelo Ramos | \/ __ | Debian 2.0 (Hamm) ||_/ / Linux registered user #118109 | \ [EMAIL PROTECTED] ||\/||\\ --
Re: .profile BASH in PATH?
On Mon, Sep 13, 1999 at 02:08:23AM -0700, bwarsing wrote: - Original Message - From: Juli-Manel Merino Vidal To run a script from the current directory: ./shell.script This is because the currect directory isn't in the path, for security reasons. Can you elaborate? Should this be changed? How do I fix this? Thanks, bw. Of course. Imagine that a user put a dangerous program in /tmp (directory in which everybody can write) named ls. If the root user have the ./ directory in the path and he is in /tmp, if he run 'ls', the system will start /tmp/ls and not /bin/ls. So, the dangerous ls can do what it wants. Bye. -- --- - Powered by Debian/GNU Linux - -- Linux User 140860 Machine 61143 -- Juli-Manel Merino Vidal [EMAIL PROTECTED]- -- -- -- -- - - http://jmmv.cjb.net/ My homepage | | | | | | | | | | | http://www.debian.org / Best linux dist. | | | | | | | | | | http://www.gnu.org / GNU Project ---| | | | | |
Re: .profile BASH in PATH?
To run a script from the current directory: ./shell.script This is because the currect directory isn't in the path, for security reasons. Can you elaborate? Should this be changed? How do I fix this? Thanks, bw. You could make a directory $HOME/bin and put your shell scripts there, and also add it to your PATH in your user .profile: PATH=$PATH:/home/username/bin export PATH That would be better than just adding . to your PATH. -- Andrew