LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Suse/Novell (http://www.linuxquestions.org/questions/suse-novell-60/)
-   -   How to : setting PATH variable for TCL (http://www.linuxquestions.org/questions/suse-novell-60/how-to-setting-path-variable-for-tcl-706544/)

raju.mopidevi 02-21-2009 10:51 PM

How to : setting PATH variable for TCL
 
hii friends , this is a simple problem , but don't mind . plz help me
i had installed tcl.
when i tried to access through commands it is giving error
Code:

$tcl
bash: tcl: command not found

But i had installed it. System path is
Code:

$ whereis tcl
tcl: /usr/lib/tcl /usr/share/tcl

To set path I had tried this command
Code:

# echo "PATH=$PATH: /usr/lib/tcl/" >> ~/.bashrc
Then onwards , when ever Terminal opened, I am getting error as
Code:

bash: /usr/lib/tcl/: is a directory
how to set correct path to tcl ??( what is my error in the command?)
how to remove error message of my wrong path command ??( /usr/lib/tcl/ is a directory )

ZAMO 02-21-2009 11:08 PM

You need to add this line in .bash_profile or you can add a file .profile and insert this line to this.

Code:

echo "PATH=$PATH:/usr/lib/tcl >> .bash_profile
Remove that from .bashrc and don't leave a space between : and /usr

mtdew3q 02-21-2009 11:10 PM

Hi-

i read where a person did this....

export PATH=/opt/tcltk-8.4/bin:$PATH

it is pointing to bin directory for tcl (whereever that resides on your system).
if you do it this way you will have to type each time you make a new shell i think.

here is the link:
export PATH=/opt/tcltk-8.4/bin:$PATH

it is worth a try anyways. thanks mtdew3q

raju.mopidevi 02-21-2009 11:35 PM

Quote:

Originally Posted by mtdew3q (Post 3452863)
Hi-

i read where a person did this....

export PATH=/opt/tcltk-8.4/bin:$PATH

it is pointing to bin directory for tcl (whereever that resides on your system).
if you do it this way you will have to type each time you make a new shell i think.

here is the link:
export PATH=/opt/tcltk-8.4/bin:$PATH

it is worth a try anyways. thanks mtdew3q


hey As you suggested, i tried as below Then i got error
Code:

linux-kt0w:/home/raju # export PATH=/usr/lib/tcl: $PATH

bash: export: `/usr/bin:/sbin:/home/raju/bin:/usr/local/bin:/usr/sbin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/opt/kde3/bin:/usr/lib/jvm/jre/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin:/home/raju/bin/ns-allinone-2.33/bin:/home/raju/bin/ns-allinone-2.33/tcl8.4.18/unix:/home/raju/bin/ns-allinone-2.33/tk8.4.18/unix:/home/raju/bin/ns-allinone-2.33/ns-2.33/:/home/raju/bin/ns-allinone-2.33/nam-1.13/:/home/raju/bin/ns-allinone-2.33/bin:/home/raju/bin/ns-allinone-2.33/tcl8.4.18/unix:/home/raju/bin/ns-allinone-2.33/tk8.4.18/unix:/home/raju/bin/ns-allinone-2.33/ns-2.33/:/home/raju/bin/ns-allinone-2.33/nam-1.13/': not a valid identifier


mtdew3q 02-22-2009 12:37 AM

Hi -

the link where i got the tip was here:
http://www.damnsmalllinux.org/f/topic-3-23-13180-5.html
export PATH=/opt/tcltk-8.4/bin:$PATH
----------------------------------------------------------------
from another site: http://www.cyberciti.biz/faq/unix-linux-adding-path/
-----------------------------------------------------------------------------------
export PATH=$PATH:/usr/local/bin

BASH / SH shell uses following syntax:
export PATH=$PATH:/path/to/dir1:/path/to/dir2

so for example:
export PATH=$PATH:/opt/ActiveTcl-8.5/bin

looking at these 2 examples from different sites they look kind of identical
and just switched around. I am not an expert but this seems to me like it works.

maybe you are specifying the name of the binary file correctly like
wish8.5 or tclsh8.5 (try using bash maybe)

i might have some links for you if this helped for some cool tcl
stuff that has to do with c++.

for my hobby i am working on other stuff now though mostly java at 3rdshiftcoder.com

i hope some of this helps.
take care -
mtdew3q

mtdew3q 02-22-2009 12:55 AM

hi-

i think you put an extra space that you may not want in your export command from
above. i believe it is supposed to run together.

mtdew3q

raju.mopidevi 02-22-2009 02:30 AM

still getting startup error
 
hey thank you for replying me !
i am still gettin an error message at Terminal startup .
Code:

raju@linux-kt0w:~>
bash: /usr/lib/tcl/: is a directory

hot to remove this error message ??

colucix 02-22-2009 04:03 AM

I reveal you a secret: there is no executable called tcl. The /usr/lib/tcl and /usr/share/tcl reported by the whereis command are indeed two directories. If you want to interactively run tcl commands, you have to type:
Code:

$ tclsh
%


raju.mopidevi 02-22-2009 04:07 AM

Hey thank You !!! it's working !!! :) :)

raju.mopidevi 02-22-2009 04:40 AM

hey that command is working !!
but how to remove that message's . Those message came by my wrong commands
Code:

# echo "PATH=$PATH: /usr/lib/tcl/" >> ~/.bashrc
that is one wrong command i had given. How to remove that message ??

colucix 02-22-2009 05:50 AM

Code:

# echo "PATH=$PATH: /usr/lib/tcl/" >> ~/.bashrc
The >> symbol, as maybe you already know, means "append to". The output of the echo command has been appended as a new line at the end of the file ~/.bashrc. At this point you have to edit this file and delete the unwanted line. In Opensuse you can use kwrite. To launch it from a terminal, just issue:
Code:

kwrite ~/.bashrc
then delete that line, save and close.

raju.mopidevi 02-22-2009 07:49 AM

yes, i know that . I had allready tried in VI editor. but i haven't found line related to that command. Please once look at my .bashrc file
Quote:

# Sample .bashrc for SuSE Linux
# Copyright (c) SuSE GmbH Nuernberg

# There are 3 different types of shells in bash: the login shell, normal shell
# and interactive shell. Login shells read ~/.profile and interactive shells
# read ~/.bashrc; in our setup, /etc/profile sources ~/.bashrc - thus all
# settings made here will also take effect in a login shell.
#
# NOTE: It is recommended to make language settings in ~/.profile rather than
# here, since multilingual X sessions would not work properly if LANG is over-
# ridden in every subshell.

# Some applications read the EDITOR variable to determine your favourite text
# editor. So uncomment the line below and enter the editor of your choice :-)
#export EDITOR=/usr/bin/vim
#export EDITOR=/usr/bin/mcedit

# For some news readers it makes sense to specify the NEWSSERVER variable here
#export NEWSSERVER=your.news.server

# If you want to use a Palm device with Linux, uncomment the two lines below.
# For some (older) Palm Pilots, you might need to set a lower baud rate
# e.g. 57600 or 38400; lowest is 9600 (very slow!)
#
#export PILOTPORT=/dev/pilot
#export PILOTRATE=115200

test -s ~/.alias && . ~/.alias || true
# LD_LIBRARY_PATH
OTCL_LIB=/home/raju/bin/ns-allinone-2.33/otcl-1.13
NS2_LIB=/home/raju/bin/ns-allinone-2.33/lib
X11_LIB=/usr/X11R6/lib
USR_LOCAL_LIB=/usr/local/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LIB:$X11_LIB:$USR_LOCAL_LIB

# TCL_LIBRARY
TCL_LIB=/home/raju/bin/ns-allinone-2.33/tcl8.4.18/library
USR_LIB=/usr/lib
export TCL_LIBRARY=$TCL_LIB:$USR_LIB

# PATH
XGRAPH=/home/raju/bin/ns-allinone-2.33/bin:/home/raju/bin/ns-allinone-2.33/tcl8.4.18/unix:/home/raju/bin/ns-allinone-2.33/tk8.4.18/unix
NS=/home/raju/bin/ns-allinone-2.33/ns-2.33/
NAM=/home/raju/bin/ns-allinone-2.33/nam-1.13/
PATH=$PATH:$XGRAPH:$NS:$NAM
That 3 path variables ( LD_LIBRARY_PATH,TCL_LIBRARY,PATH ) are the path variables,I had set for Network Simulator 2 software as a part of installation.

colucix 02-22-2009 10:39 AM

Well, the command is quite clear and the line should have been added to .bashrc. Maybe you were logged as root when applying that command? Check the files ~/.bashrc of root and of the users you normally use on this machine.

raju.mopidevi 02-22-2009 10:47 AM

yes, it's true
 
i am sorry for above , i had n't mentioned that i had edited in root mode.
even i getting message in running as mode only.( i.e. after su command )

Code:

linux-kt0w:/home/raju # vi ~/.bashrc

PATH=/usr/bin:/sbin:/home/raju/bin:/usr/local/bin:/usr/sbin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/opt/kde3/bin:/usr/lib/jvm/jre/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin:/home/raju/bin/ns-allinone-2.33/bin:/home/raju/bin/ns-allinone-2.33/tcl8.4.18/unix:/home/raju/bin/ns-allinone-2.33/tk8.4.18/unix:/home/raju/bin/ns-allinone-2.33/ns-2.33/:/home/raju/bin/ns-allinone-2.33/nam-1.13/:/home/raju/bin/ns-allinone-2.33/bin:/home/raju/bin/ns-allinone-2.33/tcl8.4.18/unix:/home/raju/bin/ns-allinone-2.33/tk8.4.18/unix:/home/raju/bin/ns-allinone-2.33/ns-2.33/:/home/raju/bin/ns-allinone-2.33/nam-1.13/: /usr/lib/tcl/
PATH=/usr/bin:/sbin:/home/raju/bin:/usr/local/bin:/usr/sbin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/opt/kde3/bin:/usr/lib/jvm/jre/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin:/home/raju/bin/ns-allinone-2.33/bin:/home/raju/bin/ns-allinone-2.33/tcl8.4.18/unix:/home/raju/bin/ns-allinone-2.33/tk8.4.18/unix:/home/raju/bin/ns-allinone-2.33/ns-2.33/:/home/raju/bin/ns-allinone-2.33/nam-1.13/:/home/raju/bin/ns-allinone-2.33/bin:/home/raju/bin/ns-allinone-2.33/tcl8.4.18/unix:/home/raju/bin/ns-allinone-2.33/tk8.4.18/unix:/home/raju/bin/ns-allinone-2.33/ns-2.33/:/home/raju/bin/ns-allinone-2.33/nam-1.13/: /usr/lib/tcl
~

my .bashrc file has this data . Now wat should i have to do ??
I don't want to remove path variables for ns, which lines i had to edit ?

raju.mopidevi 02-22-2009 10:59 AM

hey thanks !!
 
Thank you very much for replying me !!
i had edited those 2 lines .
I had deleted the statements after : at the end of each of two lines
" /usr/lib/tcl"
and " /usr/lib/tcl/"
Now i am not getting any error message after opening of terminal in "su" mode .

Thanks to all . :)


All times are GMT -5. The time now is 01:46 AM.