- code1 - Once we created the program, we wish to run it. This is usually done by simply typing its name. However, this requires that the current directory be in our PATH.
- PATH is an environment variable telling our Unix shell where to look for programs we're trying to run. To see your current PATH variable, type echo $PATH.
- ./code1 - In many cases, this directory is not placed in our PATH. This time we explicitly told our Unix shell that we want to run the program from the current directory.
- However, yet one more obstacle could block our path - file permission flags.
ls -l code1
chmod u+rwx code1 - we set the permissions of the file properly. This means the user ('u') should be given ('+') permissions read ('r'), write ('w') and execute ('x') to the file 'code1'.
ls -l code1
Cem Ozdogan
2010-02-18