Mailinglist Archive: opensuse (818 mails)

< Previous Next >
Re: [opensuse] different types of shell scripts
On Friday, September 23, 2011 16:02:28 Philipp Thomas wrote:

No. A normal user has '.' in his/her path by default, as you
can check by doing 'echo $PATH'. The user root doesn't have
'.' in PATH for the reasons I wrote.

i'll take issue with that last -- i was always told it is
dangerous and scary to put '.' in path, and have never seen a
distribution (in my limited experience) that puts it there by

i have several directories where i work on specific, isolated
projects -- my solution is to have two functions in my
~/.bashrc that add or remove $(pwd) to or from PATH -- i quote
the relevant section below:

# dangerous path extension of %PWD
function dp () {
if [[ $PATH = $PWD:* ]]
echo "PATH already has $PWD"
export PATH=${PWD}:$PATH
export PS1='\w: '
# remove dangerous path extension -- whew!
function rdp () {
export PATH=${PATH#$PWD:}
export PS1='\w> '
they also tweak the PS1 so i can tell by looking if i've done
a 'dp' already, and to remind me it's done


< Previous Next >
Follow Ups