How do I execute a program I wrote?

If you named your program "test", then you are probably executing the Unix command named "test" instead of your program. Name your program something else.

If you are getting "permission denied", check to make sure that you have execute permission for that file. Compilers usually give you execute permission when they create the executable, but editors do not! This is a common problem when writing shell scripts.

If you are getting "command not found" even though "ls" shows the file to exist, then try specifying what directory the file is in. For example, instead of using:

% a.out


% ./a.out
© Computing and Educational Technology Services