Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
echo $path
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
Kobe8Rice41
n00b
n00b


Joined: 05 Oct 2006
Posts: 27

PostPosted: Mon Nov 06, 2006 7:56 pm    Post subject: echo $path Reply with quote

How do I edit my path so that I can create commands and just run them using the name of the file rather than the full pathname. At my school all I have to say on the command line is the file name and it executes but on my home linux it doesn't work like that. If i say echo $path at school there is a lot of paths, but on mine I say that and there is nothing in my path.
Thanks
Back to top
View user's profile Send private message
Sachankara
l33t
l33t


Joined: 11 Jun 2004
Posts: 696
Location: Stockholm, Sweden

PostPosted: Mon Nov 06, 2006 8:00 pm    Post subject: Re: echo $path Reply with quote

$PATH not $path ...
_________________
Gentoo Hardened Linux 2.6.21 + svorak (Swedish dvorak)
Back to top
View user's profile Send private message
xoomix
Guru
Guru


Joined: 02 Jan 2003
Posts: 489

PostPosted: Mon Nov 06, 2006 8:02 pm    Post subject: Re: echo $path Reply with quote

Kobe8Rice41 wrote:
How do I edit my path so that I can create commands and just run them using the name of the file rather than the full pathname. At my school all I have to say on the command line is the file name and it executes but on my home linux it doesn't work like that. If i say echo $path at school there is a lot of paths, but on mine I say that and there is nothing in my path.
Thanks



Add ./ to your path - that'll execute anything if it's in the directory you're currently in (anywhere).
Back to top
View user's profile Send private message
keyson
l33t
l33t


Joined: 10 Jun 2003
Posts: 830
Location: Sweden

PostPosted: Mon Nov 06, 2006 8:03 pm    Post subject: Reply with quote

Hi.

There is a big difference between $path and $PATH.

Try
Code:
echo $PATH


If you want to run a command in the current directory do like this.
Code:
./command


Or you may set . in the path in your .bashrc

Code:
export PATH=$PATH:.


But that may give you trouble if you have a command in the current dir with the
same name as a program you want to run.
Back to top
View user's profile Send private message
Kobe8Rice41
n00b
n00b


Joined: 05 Oct 2006
Posts: 27

PostPosted: Mon Nov 06, 2006 8:11 pm    Post subject: Reply with quote

How do I add a directory to path?
Back to top
View user's profile Send private message
xoomix
Guru
Guru


Joined: 02 Jan 2003
Posts: 489

PostPosted: Mon Nov 06, 2006 8:21 pm    Post subject: Reply with quote

One way is to edit your /etc/profile where it says:

if [ "$EUID" = "0" ] || [ "$USER" = "root" ] ; then
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:${ROOTPATH}"
else
PATH="/usr/local/bin:/usr/bin:/bin:/./:/cxofficebeta/bin:${PATH}"
fi
export PATH
unset ROOTPATH


I made the relevant part red so you can see how you'd add that.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum