david neary dnearywanadoofr solocdm wrote four bindnsdomainname bindomainname binnisdomainname binypdomainname different types hostname links separate options program different behaviour depending value argv0 probably heres simple example include include include long int addlong int long int b return ab long int subtractlong int long int b return ab int mainint argc char argv long int b operands long int operationlong int long int b char progname marker ifargc 3 fprintfstderr usage int1 int2n argv0 exit1 progname strrchrargv0 ifprogname null progname argv0 else progname skip past ifstrcmpprogname add 0 operation add else strcmpprogname subtract 0 operation subtract else fprintfstderr program called invalid name quittingn argv0 exit1 strtolargv1 0 use base 16 args starting 0x base 8 args starting 0 ifmarker 0 fprintfstderr invalid character c argument sn marker argv1 exit1 b strtolargv2 0 use base 16 args starting 0x base 8 args starting 0 ifmarker 0 fprintfstderr invalid character c argument sn marker argv2 exit1 printfld c ld ldn operation add b operationa b return 0 say thats operationc compile using gcc ansi pedantic wall w o2 add operationc ln add subtract run appropriate arguments david neary marseille france email bolshgimporg irish linux users group iluglinuxie httpwwwlinuxiemailmanlistinfoilug unsubscription information list maintainer listmasterlinuxie sun 4 aug 2002 134033 0200 ilug one command four types