public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* RE: seemingly dumb-ass question
@ 2001-02-16  5:43 David Korn
  0 siblings, 0 replies; 3+ messages in thread
From: David Korn @ 2001-02-16  5:43 UTC (permalink / raw)
  To: 'Gareth Clark', gcc-help

>-----Original Message-----
>From: Gareth Clark [ mailto:balloonbending@yahoo.com ]
>Sent: 16 February 2001 13:21

>This is probably very easily answered but when i want
>to run a program which I have compiled with 'gcc
>filename.c -o filename.exe' how do i run it? if i type
>filename.exe i just get 'command not found' back. 
>I am using Red Hat 6.2 with the default version of
>gcc. 

    Hi Gareth,

 It is indeed very easy.  Linux doesn't search the current directory for
programs to be run unless you specifically add it to the path with a line
such as

 export PATH=$PATH:.

or alternatively, you can specify that your executable is in the current
directory when you try to run it by putting ./ in front of the filename

 ./filename.exe

  Of these, it is better to get into the habit of adding ./ to your 
commands, because having the current directory in your path is theoretically
a security risk (if someone could arrange for a trojan version of ls, for
example, to be in one of your directories, you might accidentally run it
when you tried to get a directory listing; if you don't have . in the path
that can't happen).

    cheers, 
        DaveK
-- 
we are not seats or eyeballs or end users or consumers.
we are human beings - and our reach exceeds your grasp.
                    deal with it.                      - cluetrain.org 


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: seemingly dumb-ass question
  2001-02-16  5:21 Gareth Clark
@ 2001-02-16  5:30 ` Lewin A.R.W. Edwards
  0 siblings, 0 replies; 3+ messages in thread
From: Lewin A.R.W. Edwards @ 2001-02-16  5:30 UTC (permalink / raw)
  To: Gareth Clark, gcc-help

Hi Gareth,

>to run a program which I have compiled with 'gcc
>filename.c -o filename.exe' how do i run it? if i type
>filename.exe i just get 'command not found' back.

By default the current directory is not in the path. Type "./filename.exe" 
(no quotes) and it will work.

=== Lewin A.R.W. Edwards (Embedded Engineer)
Work: http://www.digi-frame.com/
Personal: http://www.zws.com/ and http://www.larwe.com/

"Und setzet ihr nicht das Leben ein,
Nie wird euch das Leben gewonnen sein."

^ permalink raw reply	[flat|nested] 3+ messages in thread

* seemingly dumb-ass question
@ 2001-02-16  5:21 Gareth Clark
  2001-02-16  5:30 ` Lewin A.R.W. Edwards
  0 siblings, 1 reply; 3+ messages in thread
From: Gareth Clark @ 2001-02-16  5:21 UTC (permalink / raw)
  To: gcc-help

This is probably very easily answered but when i want
to run a program which I have compiled with 'gcc
filename.c -o filename.exe' how do i run it? if i type
filename.exe i just get 'command not found' back. 
I am using Red Hat 6.2 with the default version of
gcc. 
many thanks in advance,

gareth



__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-02-16  5:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-02-16  5:43 seemingly dumb-ass question David Korn
  -- strict thread matches above, loose matches on Subject: below --
2001-02-16  5:21 Gareth Clark
2001-02-16  5:30 ` Lewin A.R.W. Edwards

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).