-   Suse/Novell (
-   -   How to : setting PATH variable for TCL (

raju.mopidevi 02-21-2009 11: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

bash: tcl: command not found

But i had installed it. System path is

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

To set path I had tried this command

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

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-22-2009 12:08 AM

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


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

mtdew3q 02-22-2009 12:10 AM


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-22-2009 12:35 AM


Originally Posted by mtdew3q (Post 3452863)

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

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 01:37 AM

Hi -

the link where i got the tip was here:
export PATH=/opt/tcltk-8.4/bin:$PATH
from another site:
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

i hope some of this helps.
take care -

mtdew3q 02-22-2009 01:55 AM


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.


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

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

bash: /usr/lib/tcl/: is a directory

hot to remove this error message ??

colucix 02-22-2009 05: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:

$ tclsh

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

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

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

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

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

colucix 02-22-2009 06:50 AM


# 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:

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

raju.mopidevi 02-22-2009 08: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

# 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

# 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


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 11: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 11: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 )


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 11: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 12:27 PM.