LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-26-2001, 03:45 PM   #1
toxic53
Member
 
Registered: Sep 2001
Posts: 30

Rep: Reputation: 15
.o files


Say I make this program in c .... a very simple one like helloworld.c I compile:

gcc helloword.c -o hello

so I try to run hello but I get this error:

bash: hello: command not found

what do I have to do so I can run these files from anywhere in my account, say I want to make a folder called programs and another subfolder called programjune ect... and inside i have my .c and .o files. or If i simply want to run them from my ~/ ??? any suggestions???
thanks
 
Old 09-26-2001, 06:12 PM   #2
toxic53
Member
 
Registered: Sep 2001
Posts: 30

Original Poster
Rep: Reputation: 15
If anyone is still wondering...

I figured it out...

do echo $PATH
this tells you what your current path is you will need it

then do

PATH=(current path):.

this just adds '.' to the path which is current directory...the ':' is just a seperator
 
Old 09-27-2001, 01:22 AM   #3
isajera
Senior Member
 
Registered: Jun 2001
Posts: 1,635

Rep: Reputation: 45
quick tip: to run any program in the directory you're currently in, use ./ - the . indicates the current path, so it specifies the file you want to run. otherwise, it checks in the PATH directorys. so, you'd run hello with this:

./hello
 
  


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
Able to write files to MP3 player but no files written into actual device? olnex Linux - Hardware 0 11-11-2005 06:32 AM
How program to read files with extension .dat y .cfg files COMTRADE in fedora 1? ivonne Linux - Software 0 11-22-2004 11:42 AM
How can konqueror view html files in .gz & .bz2 files directly? ailinzhe Linux - Software 5 05-24-2004 08:36 AM
xine plays only (a part of) the sound of a wmv, some divx files and crushes mp4 files bezoomny Linux - Software 1 03-10-2004 07:33 PM
How to filter files in files and files which are in a sub-directory with "grep"? Piero Linux - Newbie 9 08-29-2003 02:38 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:05 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