I direct you to Kernighan & Ritchie exercise 7.1
Write a program that converts upper case to lower case or lower case to upper case depending on the name it is invoked with,…
How can I invoke the same program with different names?
I am using Linux, so I am invoking a compiled program just by entering:
$./a.out
What should I be doing differently?
You should create a symbolic link, or just copy the executable of course:
Either
or
Then in your program’s
main(), inspectargv[0]to figure out how to act. This is a pretty useful technique, actually used often by production software.