It will work if you run ./hello on the command line.
The ./ directory (which means 'the directory where I am') is usually not
included in the path where the shell looks for executable files.
HTH
Flupke
On Sun, 30 Apr 2000, Scotchpie wrote:
> Can anyone help?
> I have decided to learn C and have followed the examples in the books C in 24
> hours by Tony Zhang and Running Linux by Welsh and co.
> The problem is, after following the text for the first program very carefully
> (I used vi ) I compiled the program with
>
> gcc -o hello hello.c
>
> as I was told to. This worked fine and when I went to test it with the command
> hello at the prompt it came back that hello is not a command. I can not
> understand my mistake as I have followed the book to the letter.
> In saying that, if I start up x and open my home file, click on hello and then
> close x the phrase 'hello world' (it is my first program) appears above the
> prompt. Why can it not appear when I type I hello at the prompt as the two
> books mention?
> --
> scotchpie
>
>