LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Dash ignoring PATH? (https://www.linuxquestions.org/questions/linux-software-2/dash-ignoring-path-607142/)

BuilderQ 12-16-2007 01:16 PM

Dash ignoring PATH?
 
My dash shell seems to be ignoring the PATH set in my /etc/environment file. Trying to launch firefox with dash, for example, gives me this message "dash: Can't open firefox". I have to specify "/usr/bin/firefox" for it to work. I'm pretty sure that it didn't work this way before, since some of my shell script are now broken. I could point "/bin/sh" to bash instead (bash still works properly), but I'd like to get to the bottom of this.

I was fiddling with the PATH lately, so that may be the cause. Currently it's like this:
Code:

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/myusername/lejos/bin"
Is there a problem with it?

bigrigdriver 12-16-2007 04:21 PM

A brief search via www.google.com/linux tells me that dash sources $HOME/.profile. So, check your .profile to see if you have a line like this: set PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/myusername/lejos/bin".

BuilderQ 12-18-2007 01:07 PM

Thanks for the reply, but that doesn't seem to be working. Am I doing it right? Here is my ~/.profile file (I added the last line):
Code:

# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.

# the default umask is set in /etc/profile
#umask 022

# if running bash
if [ -n "$BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f ~/.bashrc ]; then
        . ~/.bashrc
    fi
fi

# set PATH so it includes user's private bin if it exists
if [ -d ~/bin ] ; then
    PATH=~/bin:"${PATH}"
fi

# added to try to fix path
set PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/myusername/lejos/bin"


exvor 12-18-2007 06:00 PM

I don't think you are supposed to use set with path


try:
Code:

user@system# PATH=$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/myusername/lejos/bin


All times are GMT -5. The time now is 12:30 AM.