echo $path

General chat concerning linux or linuxzoo.

Moderator: drgrussell

Post Reply
1MB
Posts: 3
Joined: Thu Nov 20, 2008 10:00 pm

echo $path

Post by 1MB » Mon Dec 22, 2008 11:40 pm

I need to run my shell script just by typing its name rather than doing sh <scrpit name>. I think its something to do with my profile and path.
echo $path is giving me output as follows:

sr/games /opt/gnome/bin /opt/kde3/bin /usr/bin/X11 /usr/local/bin /usr/bin /bin /usr/sbin /sbin /usr/lib/mit/bin /usr/lib/mit/sbin

where : is missing.

could you help sort out this problem.
thanks

drgrussell
Site Admin
Posts: 426
Joined: Sat Feb 12, 2005 8:57 pm
Are you a robot or a human?: Human

Post by drgrussell » Tue Dec 23, 2008 12:16 pm

Edit your path in your .login file. The actual name depends on your shell. However, it is likely to be .bash_profile

In there you need to add "." to the path. Add to the end of the PATH line ":."
Log out and back in again to gain the new setting.

Remember to make your shell program executable by using
chmod +x theprogramname

1MB
Posts: 3
Joined: Thu Nov 20, 2008 10:00 pm

Post by 1MB » Wed Dec 24, 2008 1:01 am

Thanks That worked

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest