LinuxQuestions.org
Help answer threads with 0 replies.
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 02-23-2005, 09:24 AM   #1
Slayer097
Member
 
Registered: Dec 2004
Distribution: Slack 10
Posts: 59

Rep: Reputation: 15
Running Programs


I've been wanting to get to work on some C++ development, but I've never before worked in a Slackware 10 enviroment. I wrote a basic program, figured out how to compile it (g++ helloworld.cpp -o helloworld), but I can't figure out an easy way to make my programs run. Typing simply "programname" doesn't work, and trying to use bash gives me "Unable to execute binary files". There's got to be an easy way to run a program other than going into the console and writing /user/home/CPP/programname everytime. Thanks.
 
Old 02-23-2005, 09:26 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
./ is a shortcut for current working directory. Unlike windows the linux shell only searches the path environment for a command.

./programname

You can also add a directory to your path.

Last edited by michaelk; 02-23-2005 at 09:28 AM.
 
Old 02-23-2005, 11:55 AM   #3
rylan76
Senior Member
 
Registered: Apr 2004
Location: Potchefstroom, South Africa
Distribution: Fedora 17 - 3.3.4-5.fc17.x86_64
Posts: 1,552

Rep: Reputation: 103Reputation: 103
Hi

Put something like

PATH=$PATH:$HOME/:./:/usr/bin

in your .bashrc, or append something similar (containing the ./) to the PATH line in your .bashrc

You should be able to "directly" start programs after closing and reopening the xterm, without typing the leading ./ required to "find" the executable.
 
Old 02-23-2005, 04:43 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
I do not suggest adding the current working directory shortcut to the path environment because it can be a security risk.
 
  


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
running programs The Oate Debian 3 08-25-2005 01:17 PM
HElP Running Programs pbrian17 Linux - Newbie 2 10-09-2004 03:03 AM
Running programs OtisLinux Linux - Software 13 01-22-2004 04:07 PM
Running programs? BajaNick Linux - General 10 07-07-2003 09:56 PM
Help on Running Programs mooreted Linux - Software 3 05-16-2003 10:32 PM

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

All times are GMT -5. The time now is 10:22 AM.

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