I would like to create a new .wc command.
closed as unclear what you're asking by HalosGhost, techraf, Ramesh, GAD3R, countermode Nov 18 '16 at 15:28
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
With the exception of shell builtins, commands are just programs. This means your question reduces to, "How do I write a program?"
wc is a good example, because it is not a shell builtin. It is just another program on the system, typically installed in
/bin/wc, depending on the OS.
In order to make your new command behave like the existing ones on the system, the program implementing it has to be installed somewhere in the
PATH. It is common on Linux distributions to put
$HOME/bin into the user's
PATH if the directory is present on login. If you want the command to be available to all users on the system, you probably want to put it somewhere else, like