running a program

Chris Jones jonesc at hep.phy.cam.ac.uk
Wed Nov 17 13:54:17 UTC 2010


Hi,

Ash Wyllie wrote:
> Now, this might sound silly, but having compiled a program, how do you run it?
> 
> I wrote and compiled a version of Ackermann's function. It is in a folder
> Ackermann.
> 
> I have a terminal window open and I am in the folder. ls shows the executable
> ack.
> 
> When I type ack I get "The program'ack' not installed ..."
> 
> What do I do next?

By default (for good security reasons, which if you are interested you 
can search for on the web, there are plenty of discussions) your current 
directory is not in your search path, therefore when you type 'ack' your 
shell does not look in your current directry, and hence does not find 
it. The standard way to work around this is to run './ack' instead, 
which is essentially a full and not relative path.

Chris




More information about the ubuntu-users mailing list