See Example 3-59 . This was originally a ksh construct adopted into Bash, and unfortunately it does not seem to work reliably in Bash scripts. This is the function of the export command. A script can export variables only to child processes, that is, only to commands or processes which that particular script initiates. A script invoked from the command line cannot export variables back to the command line environment.
Some scripts can perform different operations, depending on which name they are invoked with.
There also have to be symbolic links present to all the alternate names of the same script. If a script expects a command line parameter but is invoked without one, this may cause a null variable assignment, certainly an undesirable result. One way to prevent this is to append an extra character to both sides of the assignment statement using the expected positional parameter. This will prevent an error, even if positional parameter is absent. This uses one of the parameter substitution templates previously discussed.