FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux General Discussion

 
 
LinkBack Thread Tools
 
Old 08-10-2012, 10:40 PM
"Joe(theWordy)Philbrook"
 
Default root $PATH via "su - -c mc" ??

OK so I guess /root/.bash_profile wouldn't be read by a script generated
login shell that feeds "su - -c mc" to the -e option of a "konsole" command,
since it's not considered an "interactive" login...

Which explains why the conditional PATH command I routinely put in my
.bash_profile scripts (not in .bashrc to prevent it being appended multiple
times):

if [ -d ~/bin ] ; then
PATH="${PATH}":~/bin
fi

doesn't add "/root/bin" to the default path of the resulting "root" mc session
in the resulting konsole window, like it does with a console root login...
IE:

/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/bin/core_perl:/root/bin

But since even a generic user's default system PATH variable includes the "sbin"
directories... IE:

/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/bin/core_perl

Why would the root mc shell resulting from the scripted "su - -c mc" wind
up with a PATH variable containing only:

/usr/ucb:/bin:/usr/bin:/etc

???

I know I can fix this by defining root's path in root's .bashrc, but I'd
have to give up on conditionally adding ~/bin in .bash_profile as every
subshell would overwrite it with the .bashrc assignment...

Suggestions anyone???

--
| ~^~ ~^~
| <?> <?> Joe (theWordy) Philbrook
| ^ J(tWdy)P
| \___/ <<jtwdyp@ttlc.net>>
 

Thread Tools




All times are GMT. The time now is 10:08 AM.

VBulletin, Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org