If I have a program written in C, how can I run this program in a terminal with just a single word (the program's name), no matter where it is on the system?
Asked
Active
Viewed 169 times
1 Answers
0
See this:
http://www.linfo.org/path_env_var.html
As Pilot6 and Serg wrote in comment, You have to expand your $PATH system variable and compile program in release mode. When you will have this done, you will call myProgram and your system should check if it exists ind $PATH directories; it will eventually run it if it exists, or show error "unknown command" if it doesn't.
Szczepan
- 268