LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Suse/Novell
User Name
Password
Suse/Novell This Forum is for the discussion of Suse Linux.

Notices



Reply
 
Search this Thread
Old 02-21-2009, 11:51 PM   #1
raju.mopidevi
Senior Member
 
Registered: Jan 2009
Location: vijayawada, India
Distribution: openSUSE 11.2, Ubuntu 9.0.4
Posts: 1,155
Blog Entries: 12

Rep: Reputation: 92
Thumbs down 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 )
 
Old 02-22-2009, 12:08 AM   #2
ZAMO
Member
 
Registered: Mar 2007
Distribution: Redhat &CentOS
Posts: 579

Rep: Reputation: 30
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
 
Old 02-22-2009, 12:10 AM   #3
mtdew3q
Member
 
Registered: Mar 2006
Location: upstate NY
Distribution: xubuntu 14.04 LTS
Posts: 226

Rep: Reputation: 17
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
 
Old 02-22-2009, 12:35 AM   #4
raju.mopidevi
Senior Member
 
Registered: Jan 2009
Location: vijayawada, India
Distribution: openSUSE 11.2, Ubuntu 9.0.4
Posts: 1,155
Blog Entries: 12

Original Poster
Rep: Reputation: 92
Thumbs down

Quote:
Originally Posted by mtdew3q View Post
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
 
Old 02-22-2009, 01:37 AM   #5
mtdew3q
Member
 
Registered: Mar 2006
Location: upstate NY
Distribution: xubuntu 14.04 LTS
Posts: 226

Rep: Reputation: 17
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
 
Old 02-22-2009, 01:55 AM   #6
mtdew3q
Member
 
Registered: Mar 2006
Location: upstate NY
Distribution: xubuntu 14.04 LTS
Posts: 226

Rep: Reputation: 17
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
 
Old 02-22-2009, 03:30 AM   #7
raju.mopidevi
Senior Member
 
Registered: Jan 2009
Location: vijayawada, India
Distribution: openSUSE 11.2, Ubuntu 9.0.4
Posts: 1,155
Blog Entries: 12

Original Poster
Rep: Reputation: 92
Thumbs down 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 ??
 
Old 02-22-2009, 05:03 AM   #8
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957
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
%
 
Old 02-22-2009, 05:07 AM   #9
raju.mopidevi
Senior Member
 
Registered: Jan 2009
Location: vijayawada, India
Distribution: openSUSE 11.2, Ubuntu 9.0.4
Posts: 1,155
Blog Entries: 12

Original Poster
Rep: Reputation: 92
Thumbs up

Hey thank You !!! it's working !!!
 
Old 02-22-2009, 05:40 AM   #10
raju.mopidevi
Senior Member
 
Registered: Jan 2009
Location: vijayawada, India
Distribution: openSUSE 11.2, Ubuntu 9.0.4
Posts: 1,155
Blog Entries: 12

Original Poster
Rep: Reputation: 92
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 ??
 
Old 02-22-2009, 06:50 AM   #11
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957
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.
 
Old 02-22-2009, 08:49 AM   #12
raju.mopidevi
Senior Member
 
Registered: Jan 2009
Location: vijayawada, India
Distribution: openSUSE 11.2, Ubuntu 9.0.4
Posts: 1,155
Blog Entries: 12

Original Poster
Rep: Reputation: 92
Exclamation

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.
 
Old 02-22-2009, 11:39 AM   #13
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957
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.
 
Old 02-22-2009, 11:47 AM   #14
raju.mopidevi
Senior Member
 
Registered: Jan 2009
Location: vijayawada, India
Distribution: openSUSE 11.2, Ubuntu 9.0.4
Posts: 1,155
Blog Entries: 12

Original Poster
Rep: Reputation: 92
Smile 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 ?
 
Old 02-22-2009, 11:59 AM   #15
raju.mopidevi
Senior Member
 
Registered: Jan 2009
Location: vijayawada, India
Distribution: openSUSE 11.2, Ubuntu 9.0.4
Posts: 1,155
Blog Entries: 12

Original Poster
Rep: Reputation: 92
Lightbulb 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 .
 
  


Reply

Tags
path, variables


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
Setting PATH variable Aigarzs Linux - Newbie 2 02-07-2008 03:27 PM
Trouble setting PATH variable krutten1986 Suse/Novell 4 09-04-2006 02:21 PM
Setting Path Variable for LibXML2 Miyamoto Linux - Software 1 08-19-2003 10:00 AM
Help setting $PATH variable Nylex Linux - General 9 08-09-2003 12:44 PM
setting path variable shahrahulb Linux - General 2 07-30-2003 09:25 PM


All times are GMT -5. The time now is 03:55 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration