Making a executable into a shell command using a C program Making a executable into a shell command using a C program shell shell

Making a executable into a shell command using a C program


Add the directory in which sortx is present to $PATH. This way you could execute your program locally, like,

sortx numbers.txt

To add directory ~/my_bin to the beginning of the $PATH environment variable, add or update this in your .bash_profile:

PATH=~/my_bin:$PATH


On Linux to make any script or program globally executable (e.g "sortx" rather than "./sortx") you can put the script in wither /usr/bin or /bin -- I prefer /usr/bin :)