Posts: 74
CGarces
Joined: 21 Apr 2013
#1
Hi!

I have experienced a weird error with the OpenELEC toolchain due some"." on my path environments.

Code: Select all

$ echo $PATH
.:.:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
I don't know who create this dots in my $PATH

I have checked

Code: Select all

etc/profile
etc/bash.bashrc 
.bashrc
But I can't find it.

Any idea?
Posts: 1,445
skidoo
Joined: 09 Feb 2012
#2
web search for"openelec toolchain path" shows 6000+ results


========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"http://raspberrypi.stackexchange.com/questions/17016/customize-bashrc-in-openelec"
linktext was:"http://raspberrypi.stackexchange.com/qu ... n-openelec"
====================================

Maybe it is not operating in the context of a bash shell?
(If so, checking/editing PATH= within your .bashrc is moot)
Posts: 74
CGarces
Joined: 21 Apr 2013
#3
skidoo wrote:web search for"openelec toolchain path" shows 6000+ results


========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"http://raspberrypi.stackexchange.com/questions/17016/customize-bashrc-in-openelec"
linktext was:"http://raspberrypi.stackexchange.com/qu ... n-openelec"
====================================

Maybe it is not operating in the context of a bash shell?
(If so, checking/editing PATH= within your .bashrc is moot)
The problem not is the OpenELEC toolchain. The toolchain is just something that fails due my wrong PATH environment.

I have solved it using:

Code: Select all

PATH =/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games make
The problem is why I have the dots inside my PATH, I don't need/like it and I can't find the configuration file that create this dots in my user env. (root looks fine)

Code: Select all

$ echo $PATH
.:.:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
$ su
ContraseƱa: 
root@antix1:/media/hdd/Development/openbricks# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
.bashrc looks fine, this is the part that tweak the PATH

Code: Select all

# Add sbin directories to PATH.  This is useful on systems that have sudo

[ -z"${PATH##*/sbin*}" ] && PATH=$PATH:/sbin:/usr/sbin
Posts: 1,445
skidoo
Joined: 09 Feb 2012
#4
I can't find the configuration file that create the dots
I was suggesting that perhaps the absence of a configuration file causes the unexpected behavior.
If your openelec process is launching from within a sh or dash shell rather than bash (I can't guess),
the .bashrc is moot b/c the sh command looks for (expects) path declarations to be placed in .shinit
.bashrc looks fine, this is the part that tweak the PATH

Code: Select all

# Add sbin directories to PATH.  This is useful on systems that have sudo

[ -z"${PATH##*/sbin*}" ] && PATH=$PATH:/sbin:/usr/sbin
Ah, I think understand the problem.
That"looks fine" line performs shell expansion to eval the ${PATH##*/sbin*}
What happened when your .bashrc (or .profile) lacked a prior line containing a PATH= declaration?
Dots happened.
Why? In the absence of a pathstring declaration, the default path was"just a dot") ./