Expanding wildcard options to main()

Bruce Varney asg at sage.cc.purdue.edu
Tue Apr 2 07:37:15 AEST 1991


In article <1991Apr1.194817.20469 at fmrco> harold at fmrco (Harold Naparst) writes:
}
}How do you pass wildcard options to a program and get the
}program to expand them like ls does.  Example: suppose I 
}have two files called foo1 and foo2, and I want to run
}myprog on them.  How would I write myprog so that I could
}just do this:
}   % myprog foo*
}
}-- 
}Harold Naparst               |  (uunet!fmrco!harold) 

The glob expansion will be done by the shell before the arguments are
passed to the program.
Answer: You don't have to do anything special in your program to handle
      glob patterns
---------
sar.casm \'sa:r-.kaz-*m\ \sa:r-'kas-tik\ \-ti-k(*-)le-\ n [F sarcasme, fr. 
   LL sarcasmos, fr. Gk sarkasmos, fr. sarkazein to tear flesh, bite the lips 
   in rage, sneer, fr. sark-, sarx flesh; akin to Av thwar*s to cut] 1: a 
   cutting, hostile, or contemptuous remark : GIBE 2: the use of caustic or 
   ironic language - sar.cas.tic aj

                                   ###             ##
Courtesy of Bruce Varney           ###               #
aka -> The Grand Master                               #
asg at sage.cc.purdue.edu             ###    #####       #
PUCC                               ###                #
;-)                                 #                #
;'>                                #               ##



More information about the Comp.unix.questions mailing list