Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 28th February 2012, 02:01 PM
kintrast Offline
Registered User
 
Join Date: Feb 2012
Location: Malvern
Posts: 4
linuxfirefox
c++ a.out command not found

Recently got Fedora 16 and from terminal window did ' yum install gcc-c++ '
Using vi wrote simple c++
Then compiled ' g++ Hello.cpp ' OK so far
Typed ' a.out ' and got
bash: a.out: command not found...

I am puzzled. Anybody got any ideas what I have done wrong?
Reply With Quote
  #2  
Old 28th February 2012, 02:08 PM
jpollard Online
Registered User
 
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,107
linuxfirefox
Re: c++ a.out command not found

Try "./a.out".

By default your search path does not include the current directory for security purposes. It is safer to not have trojan commands that may exist in your working directory (or /tmp if you ever go there) executed by accident.
Reply With Quote
  #3  
Old 28th February 2012, 03:04 PM
kintrast Offline
Registered User
 
Join Date: Feb 2012
Location: Malvern
Posts: 4
linuxfirefox
Re: c++ a.out command not found

Well blow me that works. Thanks for that. When I used to work with c++ a decade ago I used a.out pretty regularly. So this is different now.

Thanks
Reply With Quote
  #4  
Old 28th February 2012, 04:04 PM
bruno.taglienti Offline
Registered User
 
Join Date: Jul 2005
Location: Roma
Age: 71
Posts: 183
linuxfirefox
Re: c++ a.out command not found

The different behaviour is probably due to the PATH variable. If PATH includes "." (=the current dir), then a.out works. If PATH does not include ".", a.out does not work, and you have to specify ./a.out to execute.
__________________
Bruno Taglienti
Reply With Quote
  #5  
Old 28th February 2012, 04:18 PM
kintrast Offline
Registered User
 
Join Date: Feb 2012
Location: Malvern
Posts: 4
linuxfirefox
Re: c++ a.out command not found

Yes I understand that now and thanks for your communication it is much appreciated.

Reply With Quote
Reply

Tags
aout, command

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
bash hangs on "command not found" and pk-command-not-found Amir Sela Guides & Solutions (No Questions) 0 21st February 2010 10:44 AM
terminal command problem "chkconfig: command not found" Omni-Tom Using Fedora 3 19th July 2008 03:29 AM
command not found pabloguevara Using Fedora 9 10th October 2006 12:21 AM
command not found zellis Using Fedora 8 25th January 2006 05:20 AM


Current GMT-time: 12:11 (Friday, 24-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat