Results 1 to 12 of 12
  1.    #1  
    it appears my path is messed up.

    Code:
    $USER@castle:~$ echo $PATH
    /usr/local/bin:/usr/bin:/bin
    /sbin isn't in the path (which is where ifconfig is and how i discovered this. it must have been when i rooted and added the optware feed.), and i'd like to add /opt/bin to the path too.

    i tried adding a .bash_profile to /var/home/$USER, but that didn't seem to work.

    anyone know how i can add those to my path?
  2. #2  
    can't you just reassign PATH?

    PATH=$PATH:/opt/bin
  3.    #3  
    sure, but i'd prefer to not have to do that every time i log in.
  4. #4  
    The shell is actually sh, not bash, so you have to use whatever file sh executes when you log in. I don't remember offhand what file that is, but it's easy to find with a quick Googling.
  5. sam1am's Avatar
    Posts
    172 Posts
    Global Posts
    176 Global Posts
    #5  
    Modify /etc/profile and add the paths you want.
  6. sam1am's Avatar
    Posts
    172 Posts
    Global Posts
    176 Global Posts
    #6  
    ...oh and to reload the config without reboot use "source"

    source /etc/profile
  7. ssrjazz's Avatar
    Posts
    786 Posts
    Global Posts
    790 Global Posts
    #7  
    I bet if you look /bin/sh is probably a symlink to /bin/bash anyway.

    That's why /etc/profile would work.
  8.    #8  
    Thanks all.

    I didn't want to edit the pre-existing file on the phone, in case I messed it up or it got overwritten during an update. So I put a .profile in /var/home/$USER/

    That did it.
  9. #9  
    Non-root users typically don't have "/sbin" or "/usr/sbin" in their default path, but the root user does. The 's' stands for 'system' and the folder contains "essential system binaries" - typically not commands used by non-privileged users. Given the model to use a user account with 'sudo', not having those items in the PATH can be inconvenient.

    Changing the definition of PATH in /etc/profile (PATH=$PATH:/opt/bin:/sbin:/usr/sbin) will "fix" this, but for individual users, it is typically done in the .profile file in the user's home directory unless you want all users to inherit the same settings. In this particular case, it probably doesn't matter, but FWIW....
  10.    #10  
    Here it is, in case anyone needs it.

    Code:
    #
    #  Set some environment variables below:
    #
    PATH="$PATH:/usr/local/sbin:/usr/sbin:/sbin:/opt/bin"
    export PATH
  11. #11  
    Step 8 on pre dev wiki: Dropbear Install has the correct way to add /opt directories to your path.

    Code:
    mkdir /etc/profile.d/
    cd /etc/profile.d/
    wget http://gitorious.org/webos-internals/bootstrap/blobs/raw/master/etc/profile.d/optware
    You drop a file in /etc/profile.d/ (you need to create that directory first) which contains the code to add directories to your path.

    Do *not* edit /etc/profile directly, as the last OTA update overwrote changes to that file for many people.

    -- Rod
    WebOS Internals and Preware Founder and Developer
    You may wish to donate by Paypal to donations @ webos-internals.org if you find our work useful.
    All donations go back into development.
    www.webos-internals.org twitter.com/webosinternals facebook.com/webosinternals
  12. #12  
    Quote Originally Posted by ssrjazz View Post
    I bet if you look /bin/sh is probably a symlink to /bin/bash anyway.

    That's why /etc/profile would work.
    /bin/sh is provided by busybox on the Pre.

    Bash is not installed by default, but can be installed from Optware if desired.

    -- Rod
    WebOS Internals and Preware Founder and Developer
    You may wish to donate by Paypal to donations @ webos-internals.org if you find our work useful.
    All donations go back into development.
    www.webos-internals.org twitter.com/webosinternals facebook.com/webosinternals

Posting Permissions