LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 08-08-2006, 10:13 PM   #1
shipon_97
Member
 
Registered: Oct 2005
Location: Bangladesh
Posts: 504

Rep: Reputation: 31
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"
OR,
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 ....

Thx...........
 
Old 08-08-2006, 10:30 PM   #2
Baix
Member
 
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, 10:49 PM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

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


Reply



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 01:05 PM
full path of a file ttilt Linux - General 1 11-08-2005 06:02 PM
get full path of a command (in C) Hady Programming 9 11-21-2003 10:50 AM
get full path of a command (in C) Hady Linux - Software 1 11-19-2003 05:46 PM
How to get executable's full path using C/C++? oldbee Programming 6 02-19-2002 09:21 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:29 PM.

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
Open Source Consulting | Domain Registration