I am having a situation for which I am looking for some suggestion.
Suppose I write a program which prints the directory names of the directories.
Is it possible to convert this program into a command (just on my system).
Not be alias but via C only.
As long as the file is executable (has the exec
xaccess for the user starting it) and can be seen from the command interpreter (usuallybashorsh), you can consider it to be a command.There will be no difference in running your own file from your path than the
lscommand for instance.Also, the C (or C++ …) language is not a requirement. There are plenty of commands in, for instance,
/usr/binthat are a script, meaning they’reshorbash(or evenperl)…xaccess right (e.g.chmod u+x file)PATH=$PATH:mypath