VectorLinux
December 21, 2014, 04:15:51 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Visit our home page for VL info. To search the old message board go to http://vectorlinux.com/forum1. The first VL forum is temporarily offline until we can find a host for it. Thanks for your patience.
 
Now powered by KnowledgeDex.
   Home   Help Search Login Register  
Please support VectorLinux!
Pages: [1]
  Print  
Author Topic: adding to $PATH (Solved)  (Read 2159 times)
sledgehammer
Vectorian
****
Posts: 1430



« on: July 15, 2013, 12:26:07 am »

So, I read omergrigg's thread
Quote
how to add a path to existing path?
« on: December 09, 2009, 11:59:45 am »
and I think I followed it, but am having problems.

If at the command line I input
Quote
xdvi sample2e.dvi
I get a lot of garbage, beginning with
Quote
warning: kpathsea: configuration file texmf.cnf not found in these directories: /usr/bin:/usr/bin/share/texmf-local/web2c:/usr/bin/share/texmf/web2c:/usr/bin/texmf-local/web2c:/usr/bin/texmf/web2c:/usr:/usr/share/texmf-local/web2c:/usr/share/texmf/web2c:/usr/texmf-local/web2c:/usr/texmf/web2c://../texmf-local/web2c:/://share/texmf-local/web2c://share/texmf/web2c://texmf-local/web2c://texmf/web2c
. If I type in
Quote
$ PATH=/usr/local/texlive/2013/bin/i386-linux:$PATH
, and then type  
Quote
xdvi sample2e.dvi
, I get a pretty dvi file.

So I tried to add
Quote
$ PATH=/usr/local/texlive/2013/bin/i386-linux:$PATH
to .bashrc as follows:

Quote
export PATH="/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/opt/bin:/usr/X11/bin:/usr/local/games:/usr/games:/usr/local/texlive/2013/bin"
,

but that doesn't work.  I still have to type in
Quote
$ PATH=/usr/local/texlive/2013/bin/i386-linux:$PATH
for xdvi to work.

Any suggestions are appreciated.  Obviously I don't know how to add something to the PATH.

John


   
   
« Last Edit: July 16, 2013, 06:43:01 am by sledgehammer » Logged

VL7.0 xfce4 Samsung RF511
retired1af
Packager
Vectorian
****
Posts: 1269



« Reply #1 on: July 15, 2013, 02:49:20 am »

Could always cheat and add /usr/local/texlive/2013/bin/i386-linux to /etc/profile
Logged

ASUS K73 Intel i3 Dual Core 2.3GHz
M0E-lnx
Administrator
Vectorian
*****
Posts: 3195



« Reply #2 on: July 15, 2013, 04:28:32 am »

make the change to your PATH in your ~/.bashrc. You'll need log out and start x again.
Logged

sledgehammer
Vectorian
****
Posts: 1430



« Reply #3 on: July 15, 2013, 07:14:14 am »

retired1af,

I tried to do that, but must have done it wrong as it didn't help. Here is the line in /etc/profile after I changed it:

Quote
# Set the default system $PATH:
PATH="/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/opt/bin:/usr/local/games:/usr/local/texlive/2013/bin/i386-linux"

Any shot that you could tell me exactly how that line should read?

M0E-lnx,

That's what I thought I did.


Thanks

John



Logged

VL7.0 xfce4 Samsung RF511
M0E-lnx
Administrator
Vectorian
*****
Posts: 3195



« Reply #4 on: July 15, 2013, 09:36:19 am »

Just add ":/usr/local/texlive/2013/bin/i386-linux" to your ~/.bashrc PATH line should be enough.  That's exactly what you did with your terminal command.

Logged

sledgehammer
Vectorian
****
Posts: 1430



« Reply #5 on: July 15, 2013, 01:13:47 pm »

Moe-lnx,

I fear you may underestimate my ability to screw up my system.  Here is my /home/johwhi/.bashrc:

Quote
# .bashrc
# sourced by BASH everytime it start
## These should be set by /etc/profile
## But sometime, bash missed them. So here is the push
export PATH="/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/opt/bin:/usr/X11/bin:/usr/local/games:/usr/games:/usr/local/texlive/2013/bin/i386-linux"
# Set various environment variables
for SH in /etc/profile.d/*.sh; do
      . $SH
done
#use custom keymap
xmodmap ~/.Xmodmap

## Set fancy colors
eval `dircolors -b`

## Set this for your first choice
#export BROWSER=seamonkey
export BROWSER=firefox
#export BROWSER=opera
#export EXPLORER=konqueror
#export NETWORK_EXPLORER=konqueror
#export AUDIO_PLAYER=xmms
#export VIDEO_PLAYER=gxine
export DISPLAY=$DISPLAY

# This line was appended by KDE
# Make sure our customised gtkrc file is loaded.
export GTK2_RC_FILES=$HOME/.gtkrc-2.0

Neither restarting X nor rebooting helps.  I have to type in at the command prompt

Quote
PATH=/usr/local/texlive/2013/bin/i386-linux:$PATH
for xdvi to work from the command line.

Here is result of locate ./bashrc:



Quote
vector:/~
johwhi:$ locate .bashrc
/etc/skel/.bashrc
/home/johwhi/.local/share/Trash/files/regina/.bashrc
/home/johwhi/.local/share/Trash/files/linda/.bashrc
/home/johwhi/.bashrc

I wonder if the fact that I have a .bashrc in /etc/skel is the problem?
Logged

VL7.0 xfce4 Samsung RF511
roarde
Vectorian
****
Posts: 554


move the needle


« Reply #6 on: July 15, 2013, 06:49:26 pm »

Open terminal. 'printenv PATH'. Keep the terminal open.
Open xfce's "run" dialog (or equivalent -- I'm not an xfce user, so please translate if needed). 'printenv PATH >~/pathlog'.
Now 'cat ~/pathlog' in the terminal.

See?

Now everyone try it. Please.

You've just discovered what .bashrc is NOT for.

.bashrc is only to be used to set the characteristics of an interactive bash session! and even then, it's still not supposed to be used if said session is the login session.
Obviously, I've been holding on to this one for a long time.

The X session does not reference .bashrc or any shell startup script unless it has been improperly hacked to do so. The terminal has it because it starts an interactive (presumably bash) shell session.

But for many years, everything that needs setting has found its way into .bashrc in many, many distros. VL is certainly not alone. To this day, new applications are developed by whiz-bang linux coders that have in their install instructions " . . . and add this line to your ~/.bashrc".

None of which gets sledgehammer a readable dvi automatically.

For now, any fix will be a plain 'ol hack. A kludge. This one looks pretty good, just scroll up in its thread to understand how to de-edit it and use.
https://bbs.archlinux.org/viewtopic.php?pid=1006333#p1006333

At some near point, there needs to be a standard way to get from login to an X session and DE/WM that is consistent across environments and where the basic settings are in the same place for all types of session. But desired differences between environments -- whether they be different shells, twm, or just two slightly different xfce sessions -- need to be allowed for. All in a standard, consistent way.

So for this question, the answer is to find a way to put PATH where XFCE will pick it up. Looks like it doesn't get it from where it is now. If the above link doesn't solve it, you'll need to know how VL gets from gdm to XFCE and throw a PATH in its path.
Logged

Robert
VL STD 7.1 RC3.1, icewmvmods
sledgehammer
Vectorian
****
Posts: 1430



« Reply #7 on: July 15, 2013, 11:07:58 pm »

Thanks Roard,  Its pretty clear I have some work to do.  printenv PATH produces:

Quote
vector:/~
johwhi:$ printenv PATH
/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/opt/bin:/usr/X11/bin:/usr/local/games:/usr/games:/usr/local/texlive/2013/bin/i386-linux:/opt/java/bin:/opt/java/db/bin:/usr/lib/java/bin:/usr/lib/kde4/libexec:/opt/kde3/lib/qt3/bin:/opt/kde3/bin:/usr/lib/qt/bin
vector:/~

But I haven't yet found a run dialog.  Xfce 4 Utilities and Scripts (http://www.fullsack.com/gnnix/base/root/dist/usr/share/xfce4/doc/C/xfce-utils.html) says the "run dialog" is xfrun4 but all that brings up is the "applications finder" window, a window I use to run programs such as ETM.
Quote
The run dialog allows the user to launch applications. Applications can be run in a Terminal emulator (xterm by default, see xfterm4 script below).

In a default Xfce 4 environment, the Alt+F2 key combination will open the run dialog.

Putting 'printenv PATH >~/pathlog' in the applications finder (xfrun4) does nothing.  I will go through the rest of your post as time permits.

John
Logged

VL7.0 xfce4 Samsung RF511
rbistolfi
Packager
Vectorian
****
Posts: 2291


« Reply #8 on: July 16, 2013, 03:44:04 am »

Note that when in the interactive shell, you put the tex path before the rest:

Code:
PATH=/usr/local/texlive/2013/bin/i386-linux:$PATH

However in bashrc, the texlive directory is at the end. Not sure if this is the cause of the behaivor you are experiencing, but they are not the same because the executables are looked up in the $PATH directories in order. If there is another tex install in the PATH and it is found first, then the wrong binary will be picked.
In my opinion, a good place for this setting is /etc/profile.d/texlive.sh:

Code:
#!/usr/bin/env bash
export PATH=/your/path:$PATH

HTH
Logged

"There is a concept which corrupts and upsets all others. I refer not to Evil, whose limited realm is that of ethics; I refer to the infinite."
Jorge Luis Borges, Avatars of the Tortoise.

--
Jumalauta!!
sledgehammer
Vectorian
****
Posts: 1430



« Reply #9 on: July 16, 2013, 06:41:45 am »

Thanks Rodrigo,

your texlive.sh suggestion worked perfectly.

John
Logged

VL7.0 xfce4 Samsung RF511
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!