*BSD News Article 93748


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!news.mel.connect.com.au!munnari.OZ.AU!news.ecn.uoknor.edu!feed1.news.erols.com!howland.erols.net!blackbush.xlink.net!ka.sub.net!rz.uni-karlsruhe.de!not-for-mail
From: Philipp Mergenthaler <un1i@rz.uni-karlsruhe.de>
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: Help with a.out
Date: 17 Apr 1997 07:58:35 GMT
Organization: University of Karlsruhe, Germany
Lines: 23
Sender: Philipp Mergenthaler <un1i@rzstud1.rz.uni-karlsruhe.de>
Message-ID: <5j4l7b$8cb$1@nz12.rz.uni-karlsruhe.de>
References: <3355973C.429F@charlotte.infi.net>
NNTP-Posting-Host: rzstud1.rz.uni-karlsruhe.de
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Newsreader: TIN [UNIX 1.3 unoff BETA 970409; 9000/819 HP-UX B.10.10]
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.freebsd.misc:39199


 drdan <mdan@charlotte.infi.net> wrote:
> I am trying to write small programs in C++. I have been compiling with
> g++ and it gives me a file a.out I assume this is a executable. 
> Although, when I type a.out I get an error message that says that
> command a.out is not found.  I must be forgetting to do somthing simple,
> please help me.

The shell looks for executable files only in the directories which are
listed in the $PATH variable. Probably your file isn't in one of these.
You can
- move it to one of these, e.g. $HOME/bin ,then do "rehash"
- include this directory into the $PATH (look at .profile, .cshrc etc.)
- easiest way: give the exact path, e.g. $HOME/c-progs/a.out  or,
  if you're already in that directory: ./a.out


Bye, Philipp

-- 
P. Mergenthaler, un1i@rz.uni-karlsruhe.de  |  Wer halb gebildet, ist der
Tel.: 0721/694532                          |     schoenste Narr.
Klosterweg 28 / I609, 76131 Karlsruhe      | (Weiss jemand, von wem das ist?)
http://www.uni-karlsruhe.de/~un1i/         |