Peter Percival wrote:
> Alister wrote:
> > On Thu, 05 Jul 2018 15:43:27 +0100, Peter Percival wrote:
> >
> >> Jan Panteltje wrote:
> >>> On a sunny day (Thu, 5 Jul 2018 14:22:06 +0100) it happened Peter
> >>> Percival wrote in
> >>> :
> >>>
> >>>> I wrote a "Hello world" program in C.
> >>>>
> >>>> gcc hello.c
> >>>>
> >>>> creates a.out without warnings or error messages. ls shows that a.out
> >>>> exists.
> >>>>
> >>>> a.out
> >>>>
> >>>> gets the response
> >>>>
> >>>> -bash: a.out: command not found
> >>>
> >>> Try ./aout
> >>>
> >>> For compile, better use gcc -Wall -o hello hello.c
> >>>
> >>> ./hello
> >>>
> >>>
> >> Thank you. I have added . to PATH and it now works.
> > please reconsider that approach carefully, it opens up a bunch of
> > potential security risks
> >
>
> I am new to all this! What are they? Is there an appropriate directory
> in which I can put my executables, and whose name I may safely add to PATH?
>
The usual/easy thing is to create a directory 'bin' in your home
directory, i.e. mine is /home/chris/bin, and add that to your PATH
(it *may* get added automatically, some login scripts do this for
you). Then you can put any shell scripts and/or other executables
there and they will be found when you try to run them with just their
name.
--
Chris Green
ยท
--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)
|