Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 08-08-2006, 11:13 PM   #1
Registered: Oct 2005
Location: Bangladesh
Posts: 497

Rep: Reputation: 30
Question Run any Script without metioning the full path

Dear Friends ,

Suppose I make a script name "test" in "tmp" Directory . Now when I want to run this script then I run it in the following way :

"sh /mnt/test"

But i want to run this script like the following way :

"service test restart"
I want a situation where I can run my script from any place , not to mention the full path like(root~# sh test). Is it possible to do ?

If yes then plz tell me how can I do it ?Wating for your reply ....

Old 08-08-2006, 11:30 PM   #2
Registered: Jun 2004
Distribution: Gentoo, LFS, Slackware
Posts: 203

Rep: Reputation: 30
You need to move the file to a directory listed in the PATH variable (try 'echo $PATH'), generally /usr/bin.
Old 08-08-2006, 11:49 PM   #3
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 740Reputation: 740Reputation: 740Reputation: 740Reputation: 740Reputation: 740Reputation: 740
Or add the directory to PATH
Or make a link to the file--put the link in a directory that is in PATH


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
script to change unix path to windows path in all files csross Programming 8 04-29-2006 02:05 PM
full path of a file ttilt Linux - General 1 11-08-2005 07:02 PM
get full path of a command (in C) Hady Programming 9 11-21-2003 11:50 AM
get full path of a command (in C) Hady Linux - Software 1 11-19-2003 06:46 PM
How to get executable's full path using C/C++? oldbee Programming 6 02-19-2002 10:21 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:25 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration