Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Making a executable into a shell command using a C program

I've a executable named say "sortx". Now I want to write a C program which transforms this executable into a shell command.

ex: ./sortx numbers.txt

After running the C program on "sortx" what I want is :

sortx numbers.txt

like image 500
VoodooChild92 Avatar asked Mar 19 '26 03:03

VoodooChild92


1 Answers

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
like image 123
rahool Avatar answered Mar 21 '26 21:03

rahool