LinuxQuestions.org
Visit Jeremy's Blog.
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 12-15-2006, 12:28 AM   #1
amanjsingh
Member
 
Registered: Mar 2004
Location: New York, USA
Distribution: Debian, Ubuntu
Posts: 71

Rep: Reputation: 15
To start a program from any directory


I want to run a program shoutcast from any directory that i am currently on. It is not necessary that the program should reside in the same directory. I just want to install it and then whenever I want by just typing ./sc_ver command. Not necessarily being in that directory.

Is there a global variable file in which if I put an entry will work?

Thanks
AJ
 
Old 12-15-2006, 12:39 AM   #2
IBall
Senior Member
 
Registered: Nov 2003
Location: Perth, Western Australia
Distribution: Ubuntu, Debian, Various using VMWare
Posts: 2,088

Rep: Reputation: 62
What you need to do is put the program "sc_ver" in /usr/bin. You will need to be root. You can either copy it, or (better) create a symbolic link. To create symbolic link:
Code:
ln -s /path/to/shoutcast/sc_ver /usr/bin
Where /path/to/shoutcast is the path to wherever sc_ver is.

If you do this, then you start the program like any other - no ./ needed. The ./ just means the current directory - ie ./sc_ver means execute the sc_ver that is in the current directory.

I hope this helps
--Ian
 
Old 12-15-2006, 12:41 AM   #3
amanjsingh
Member
 
Registered: Mar 2004
Location: New York, USA
Distribution: Debian, Ubuntu
Posts: 71

Original Poster
Rep: Reputation: 15
Thanks. I will try and let you know. but thanks a lot, that was quite clear.
 
Old 12-15-2006, 12:43 AM   #4
bitva
Member
 
Registered: Dec 2002
Location: Los Angeles
Distribution: Debian
Posts: 72

Rep: Reputation: 15
There is an environment variable called PATH which contains directorys to look into when you want to execute something.

Run: echo $PATH

It should return something like:

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11

You can either place the shoutcast executable in one of those directories and then logout and login again or you can create your own directory and add that directory to the PATH environment variable. The variable is usualy set when you login and during your login .bashrc or .profile in your home directory (sometimes not though) is sourced and the PATH environment is set either in there or by again sourcing /etc/profile. Take alook at those to files and see if you see a line that looks like:

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11"

and add your new directory with the executable in it to it (seperate by semicolon). Logout and back in again and you should be good to go.

When executing shoutcast though, you won't need/want to type ./ before it. ./ means current directory.
 
  


Reply


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
How do I automatically start a program at start up? victordh Linux - General 7 10-27-2013 07:02 AM
program running from one directory, but not another DA WEED WIZARD Linux - Newbie 2 03-29-2006 02:03 PM
Program directory help... JustinCoyan Slackware 3 04-19-2005 11:27 AM
Program Directory nodnarb Linux - Software 2 07-18-2004 10:18 PM
Directory travesal program serotonincy Programming 3 02-22-2004 01:42 PM


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