LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-13-2014, 06:55 PM   #1
kwatts59
Member
 
Registered: Aug 2012
Posts: 34

Rep: Reputation: Disabled
Path is not getting set correctly


Hi all,
I am having problems with setting my PATH environment variable.
I am trying to include the path to my cufflinks-2.2.0 program so I can run the latest version of my cufflinks software.

Here is my .bashrc file

Code:
# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
	. /etc/bashrc
fi

export PATH=$PATH:/usr/local/bioinfo/cufflinks-2.2.0.Linux_x86_64
However, when I try running my cufflinks program, it always runs the old version 2.1.1. When I type "echo $PATH" I get the following output (line feeds were added for clarity) :
Code:
/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:
/usr/local/bioinfo/blast_2.2.28+/bin:
/sbin/:/usr/sbin:/usr/local/bioinfo/bowtie2-2.1.0:
/usr/local/bioinfo/tophat-2.0.9.Linux_x86_64:
/usr/local/bioinfo/samtools-0.1.9:
/usr/local/bioinfo/cufflinks-2.1.1.Linux_x86_64:
/home/kwatanabe/bin/i686:/usr/local/bioinfo/ncbi-blast-2.2.25+/bin:
/usr/local/bioinfo/bioprospector:
/home/kwatanabe/bin:/usr/local/bioinfo/blast_2.2.28+/bin:
/usr/local/bioinfo/cufflinks-2.2.0.Linux_x86_64

Notice that there are 2 entries for a cufflinks directory.
Where does this cufflinks-2.1.1 directory get added to PATH?



Below is the /etc/bashrc file verbatum

Code:
# /etc/bashrc

# System wide functions and aliases
# Environment stuff goes in /etc/profile

# It's NOT good idea to change this file unless you know what you
# are doing. Much better way is to create custom.sh shell script in
# /etc/profile.d/ to make custom changes to environment. This will
# prevent need for merging in future updates.

# By default, we want this to get set.
# Even for non-interactive, non-login shells.
# Current threshold for system reserved uid/gids is 200
# You could check uidgid reservation validity in
# /usr/share/doc/setup-*/uidgid file
if [ $UID -gt 199 ] && [ "`id -gn`" = "`id -un`" ]; then
    umask 002
else
    umask 022
fi

# are we an interactive shell?
if [ "$PS1" ]; then
    case $TERM in
    xterm*)
        if [ -e /etc/sysconfig/bash-prompt-xterm ]; then
            PROMPT_COMMAND=/etc/sysconfig/bash-prompt-xterm
        else
            PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}"; echo -ne "\007"'
        fi
        ;;
    screen)
        if [ -e /etc/sysconfig/bash-prompt-screen ]; then
            PROMPT_COMMAND=/etc/sysconfig/bash-prompt-screen
        else
            PROMPT_COMMAND='echo -ne "\033_${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}"; echo -ne "\033\\"'
        fi
        ;;
    *)
        [ -e /etc/sysconfig/bash-prompt-default ] && PROMPT_COMMAND=/etc/sysconfig/bash-prompt-default
        ;;
    esac
    # Turn on checkwinsize
    shopt -s checkwinsize
    [ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ "
    # You might want to have e.g. tty in prompt (e.g. more virtual machines)
    # and console windows
    # If you want to do so, just add e.g.
    # if [ "$PS1" ]; then
    #   PS1="[\u@\h:\l \W]\\$ "
    # fi
    # to your custom modification shell script in /etc/profile.d/ directory
fi

if ! shopt -q login_shell ; then # We're not a login shell
    # Need to redefine pathmunge, it get's undefined at the end of /etc/profile
    pathmunge () {
        case ":${PATH}:" in
            *:"$1":*)
                ;;
            *)
                if [ "$2" = "after" ] ; then
                    PATH=$PATH:$1
                else
                    PATH=$1:$PATH
                fi
        esac
    }

    # Only display echos from profile.d scripts if we are no login shell
    # and interactive - otherwise just process them to set envvars
    for i in /etc/profile.d/*.sh; do
        if [ -r "$i" ]; then
            if [ "$PS1" ]; then
                . $i
            else
                . $i >/dev/null 2>&1
            fi
        fi
    done

    unset i
    unset pathmunge
fi
# vim:ts=4:sw=4

#for blast-2.2.28
export PATH=$PATH:/usr/local/bioinfo/blast_2.2.28+/bin
Any help would be appreciated.
Thanks in advance.

Last edited by kwatts59; 04-13-2014 at 06:57 PM. Reason: typo
 
Old 04-13-2014, 07:24 PM   #2
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Did you check your .bash_profile file?

You could also put your entry before the rest of the entries in PATH instead of after:
Code:
export PATH=/usr/local/bioinfo/cufflinks-2.2.0.Linux_x86_64:$PATH
 
Old 04-14-2014, 12:24 PM   #3
kwatts59
Member
 
Registered: Aug 2012
Posts: 34

Original Poster
Rep: Reputation: Disabled
Here is my .bash_profile. I don't see anything suspicious.

Code:
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
	. ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH
I fixed the problem by putting the following line as the first line of my .bashrc file

Code:
export PATH='/usr/local/sbin:/usr/local/bin:/bin:/usr/bin'
This clears the PATH variable of any prior definitions.
I don't know if this is the best way to fix the problem but it works.
Thanks all for your help.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Cannot find executable although PATH is set correctly Space_C0wb0y Linux - Software 4 08-11-2010 09:45 AM
Cannot correctly set up the PATH environment variable Centos dralexpe Linux - Software 7 05-30-2008 11:23 PM
Set the path systemwide/Set the path for a user with Slackware jayhel Slackware 1 06-12-2005 12:24 AM
Java can't find package, but PATH set correctly (j2se1.4.0, java.util.regex package) Ethan Programming 5 02-06-2004 09:55 PM
How to set PATH How do I set PATH environment variable? Tranquil Linux - Newbie 3 11-02-2003 02:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration