Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sdd.hp.com!spool.mu.edu!news.cs.indiana.edu!news.nd.edu!mentor.cc.purdue.edu!sage.cc.purdue.edu!asg From: asg@sage.cc.purdue.edu (Bruce Varney) Newsgroups: comp.unix.questions Subject: Re: Expanding wildcard options to main() Message-ID: <9217@mentor.cc.purdue.edu> Date: 1 Apr 91 21:37:15 GMT Article-I.D.: mentor.9217 References: <1991Apr1.194817.20469@fmrco> Sender: news@mentor.cc.purdue.edu Reply-To: asg@sage.cc.purdue.edu (Bruce Varney) Organization: Purdue University Lines: 30 In article <1991Apr1.194817.20469@fmrco> harold@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@sage.cc.purdue.edu ### ##### # PUCC ### # ;-) # # ;'> # ##