Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!husc6!cmcl2!brl-adm!adm!oxy!bagpiper@csvax.caltech.EDU From: bagpiper@csvax.caltech.EDU Newsgroups: comp.lang.c Subject: argv[0] Message-ID: <8688@brl-adm.ARPA> Date: Thu, 6-Aug-87 23:14:38 EDT Article-I.D.: brl-adm.8688 Posted: Thu Aug 6 23:14:38 1987 Date-Received: Sat, 8-Aug-87 15:04:55 EDT Sender: news@brl-adm.ARPA Lines: 20 This gets a little bit away from the mainstream of the conversation, but I have used argv[0] to determine what the program does. BACKGROUND & EXPLAINATION: At the college I attend we have a PRIME 9955 mod I running PrimOS (yuch!!) anbd PRIMIX (not much better..maybe worse!). sh does not have any alias ability so I wrote a C prog with that name that did the argument line translations (primix to primos filename mappings are ugly..you can have a filename in one that the other will not recognize) and then exec the proper prog. Will I quickly realized that if it exec'd argv[0] that I could use the same code for a lot of things. Thought that this might be interesting... Michael Hunter UUCP : ....{seismo, rutgers, ames}!cit-vax!oxy!bagpiper Box 241 ARPA : oxy!bagpiper@csvax.caltech.edu Occidental College BITNET: oxy!bagpiper@hamlet.bitnet Los Angeles, CA 90041 CSNET : oxy!bagpiper%csvax.caltech.edu@relay.cs.net