You are not logged in.

#1 2015-08-10 07:02:25

dxxvi
Member
Registered: 2011-07-23
Posts: 122

[Solved] Where does this path in PATH come from?

Hi Everybody,

My $HOME variable is /home/ly. When I start my xfce4-terminal, the PATH is

/home/ly/maven-3.1.1/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/java-8-openjdk/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl

My ~/.bashrc is

#
# ~/.bashrc
#

# If not running interactively, don't do anything
[[ $- != *i* ]] && return

alias ls='ls --color=auto'
PS1='[\u@\h \W]\$ '

export EDITOR="vi"

My ~/.bash_profile is

export EDITOR=vi
export M2_HOME=$HOME/maven-3.3.3
export GRADLE_HOME=$HOME/gradle
export PATH=$M2_HOME/bin:$GRADLE_HOME/bin:$PATH

My /etc/bash.bashrc is

#
# /etc/bash.bashrc
#

# If not running interactively, don't do anything
[[ $- != *i* ]] && return

PS1='[\u@\h \W]\$ '
PS2='> '
PS3='> '
PS4='+ '

case ${TERM} in
  xterm*|rxvt*|Eterm|aterm|kterm|gnome*)
    PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND; }'printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/\~}"'

    ;;
  screen)
    PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND; }'printf "\033_%s@%s:%s\033\\" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/\~}"'
    ;;
esac

[ -r /usr/share/bash-completion/bash_completion   ] && . /usr/share/bash-completion/bash_completion

I wonder where the /home/ly/maven-3.1.1/bin comes from.

Thanks.

Solved: The reason for everything is that I used maven-3.1.1 before, had it in .bash_profile, then I upgraded it to maven-3.3.3, modified .bash_profile but didn't log out. That happened about 6 weeks ago and now I forgot I did that.

Last edited by dxxvi (2015-08-12 02:02:03)

Offline

#2 2015-08-10 07:11:07

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [Solved] Where does this path in PATH come from?

What have you got in /etc/profile.d/? And how do you start xfce?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2015-08-10 10:25:36

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [Solved] Where does this path in PATH come from?

If the above doesn't shed any light on the issue, try brute force:

sudo ag maven /etc

https://www.archlinux.org/packages/?sor … =&flagged=

Offline

#4 2015-08-10 10:47:03

Awebb
Member
Registered: 2010-05-06
Posts: 6,294

Re: [Solved] Where does this path in PATH come from?

Beware, that ag does not search hidden files (DOT filename) by default. It also didn't find my test words in pacnew files.

Offline

#5 2015-08-10 10:55:59

dxxvi
Member
Registered: 2011-07-23
Posts: 122

Re: [Solved] Where does this path in PATH come from?

jasonwryan wrote:

What have you got in /etc/profile.d/? And how do you start xfce?

My /etc/profile.d/ has gpm.sh  jre.csh  jre.sh  locale.sh  perlbin.csh  perlbin.sh  vte.sh and none of those files has anything related to maven. One more strange thing is that my ~/.bash_profile didn't seem to be executed.
I use openbox and start xfce4-terminal with this line in ~/.config/openbox/autostart

( sleep 1s && /usr/bin/xfce4-terminal ) &
karol wrote:

If the above doesn't shed any light on the issue, try brute force:

sudo ag maven /etc

That command returns nothing. By the way, does the ag maven /etc give anything different from find /etc -type f | xargs grep maven ?

Thanks.

Offline

#6 2015-08-10 11:01:41

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: [Solved] Where does this path in PATH come from?

dxxvi wrote:

I use openbox

Then how do you start openbox or more general how do you start X with whatever environment you use? DMs don't always respect your $SHELL and only execute ~/.profile and/or ~/.xprofile.

Offline

#7 2015-08-10 11:14:45

Awebb
Member
Registered: 2010-05-06
Posts: 6,294

Re: [Solved] Where does this path in PATH come from?

Don't pipe xargs grep, use -exec:

find /etc -type f -exec grep -l $SEARCHTERM {} \;

The -l grep switch outputs the filename instead of the text line. Was it -l? Man yourself. The output of ag is indeed very different. Not only does display and color the text, it searches for all combinations of your search term (upper/lowercase), but does not search hidden files and non-text files by default.

Offline

#8 2015-08-11 00:50:34

dxxvi
Member
Registered: 2011-07-23
Posts: 122

Re: [Solved] Where does this path in PATH come from?

Raynman wrote:

Then how do you start openbox or more general how do you start X with whatever environment you use? DMs don't always respect your $SHELL and only execute ~/.profile and/or ~/.xprofile.

My computer starts into the command prompt, then I run startx to start openbox. My ~/.xinitrc is exec openbox-session.

Awebb wrote:

Don't pipe xargs grep, use -exec:

find /etc -type f -exec grep -l $SEARCHTERM {} \;

Thanks for that.

Does anybody have any other idea why maven-3.1.1 is in my PATH and why .bash_profile is not executed?

Offline

#9 2015-08-11 00:52:02

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [Solved] Where does this path in PATH come from?

Offline

#10 2015-08-11 01:12:33

dxxvi
Member
Registered: 2011-07-23
Posts: 122

Re: [Solved] Where does this path in PATH come from?

Thanks for that link. I just read it but still don't know how to solve my issue. Could you please clarify a little bit?

Offline

#11 2015-08-11 01:48:18

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [Solved] Where does this path in PATH come from?

You can check htop or run

pgrep -at tty1 bash

assuming you start on tty1.
If you're using systemd, try

loginctl session-status

What's the output of

ls ~/.profile* ~/.bash*

Offline

#12 2015-08-11 05:49:01

boban_dj
Member
Registered: 2015-03-17
Posts: 150

Re: [Solved] Where does this path in PATH come from?

Maybe you installed maven 2 times, once from the official packages, once just make manual  in $HOME dir, or upgraded? Did you manually enter in .bash_profile the exports?
Look at the older version PKGBUILD for maven 3.1.1, where the PATH is being exported to

Offline

#13 2015-08-12 01:31:13

dxxvi
Member
Registered: 2011-07-23
Posts: 122

Re: [Solved] Where does this path in PATH come from?

karol wrote:

You can check htop or run

pgrep -at tty1 bash

That command returns 341 -bash

loginctl session-status

returns

[ly@ArchCustom shm]$ loginctl session-status
c1 - ly (1000)
           Since: Sat 2015-08-01 22:09:09 EDT; 1 weeks 2 days ago
          Leader: 307 (login)
            Seat: seat0; vc1
             TTY: tty1
         Service: login; type tty; class user
           State: active
            Unit: session-c1.scope
                  ├─  307 login -- ly     
                  ├─  341 -bash
                  ├─  392 /bin/sh /usr/bin/startx
                  ├─  414 xinit /home/ly/.xinitrc -- /etc/X11/xinit/xserverrc :0 vt1 -auth /tmp/serverauth.NrY9dDVdBN
                  ├─  415 /usr/lib/xorg-server/Xorg -nolisten tcp :0 vt1 -auth /tmp/serverauth.NrY9dDVdBN
                  ├─  419 /usr/bin/openbox --startup /usr/lib/openbox/openbox-autostart OPENBOX
                  ├─  431 sh /home/ly/.config/openbox/autostart
                  ├─  432 sh /home/ly/.config/openbox/autostart
                  ├─  433 sh /home/ly/.config/openbox/autostart
                  ├─  434 sh /home/ly/.config/openbox/autostart
                  ├─  437 sh /home/ly/.config/openbox/autostart
                  ├─  445 tint2
                  ├─  446 /usr/bin/xfce4-terminal
                  ├─  447 nm-applet
                  ├─  448 /usr/bin/gedit
                  ├─  449 conky
                  ├─  454 dbus-launch --autolaunch=04afc3e42a744ab09a0bf17758a7dcdd --binary-syntax --close-stderr
                  ├─  461 /usr/bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session
                  ├─  468 /usr/lib/at-spi2-core/at-spi-bus-launcher
                  ├─  473 /usr/bin/dbus-daemon --config-file=/etc/at-spi2/accessibility.conf --nofork --print-address 3
                  ├─  476 /usr/lib/at-spi2-core/at-spi2-registryd --use-gnome-session
                  ├─  498 /usr/lib/dconf/dconf-service
                  ├─  502 gnome-pty-helper
                  ├─  503 bash
                  ├─  519 /usr/lib/GConf/gconfd-2
                  ├─  565 bash
                  ├─  566 bash
                  ├─  568 bash
                  ├─ 1371 nemo --no-desktop
                  ├─ 2908 bash
                  ├─ 4588 loginctl session-status
                  ├─ 4589 less
                  ├─ 5066 adb -P 5037 fork-server server
                  ├─ 9709 bash
                  ├─10028 bash
                  ├─10314 /usr/lib/virtualbox/VirtualBox
                  ├─10328 /usr/lib/virtualbox/VBoxXPCOMIPCD
                  ├─10334 /usr/lib/virtualbox/VBoxSVC --auto-shutdown
                  ├─30631 firefox-beta-bin -private
                  └─31234 qbittorrent

Aug 02 02:47:36 ArchCustom crontab[29139]: (ly) REPLACE (ly)
Aug 02 02:47:36 ArchCustom crontab[29139]: (ly) END EDIT (ly)
Aug 02 02:47:39 ArchCustom crontab[29152]: (ly) LIST (ly)
Aug 02 02:49:40 ArchCustom crontab[29197]: (ly) BEGIN EDIT (ly)
Aug 02 02:50:18 ArchCustom crontab[29197]: (ly) REPLACE (ly)
Aug 02 02:50:18 ArchCustom crontab[29197]: (ly) END EDIT (ly)
Aug 02 03:41:49 ArchCustom firefox-beta-bin[450]: getaddrinfo*.gaih_getanswer: got type "DNAME"
Aug 02 03:41:49 ArchCustom firefox-beta-bin[450]: getaddrinfo*.gaih_getanswer: got type "DNAME"
Aug 02 03:59:14 ArchCustom firefox-beta-bin[450]: getaddrinfo*.gaih_getanswer: got type "DNAME"
Aug 02 03:59:14 ArchCustom firefox-beta-bin[450]: getaddrinfo*.gaih_getanswer: got type "DNAME"
ls ~/.profile* ~/.bash*

returns

ls: cannot access /home/ly/.profile*: No such file or directory
/home/ly/.bash_history  /home/ly/.bash_logout  /home/ly/.bash_profile  /home/ly/.bashrc
boban_dj wrote:

Maybe you installed maven 2 times, once from the official packages, once just make manual  in $HOME dir, or upgraded?Look at the older version PKGBUILD for maven 3.1.1, where the PATH is being exported to

I don't install the maven package. pacman -Q | grep maven returns nothing. The one in $HOME was downloaded manually and unzipped there.

boban_dj wrote:

Did you manually enter in .bash_profile the exports?

Yes, I did.

Does anybody have any idea? Thanks.

Offline

Board footer

Powered by FluxBB