From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,2da5d5e41670269 X-Google-Attributes: gidfee84,public From: dsr@mail.lns.cornell.edu (Daniel S. Riley) Subject: wordexp (not Re: nanosleep ?) Date: 1999/08/25 Message-ID: #1/1 X-Deja-AN: 517060957 References: <37BCF41F.1EC5804D@de.ans.thomson-csf.com> <37C0ED14.9560FA43@psi.ch> <37C14023.B0712F05@compaq.com> Organization: LNS, Cornell U., Ithaca, NY 14853 Newsgroups: comp.unix.osf.osf1 dblake@popper.ucsf.edu (David T. Blake) writes: > So that if the environment is not what ksh wants, you get a return > value of zero. What do I need to do in my program to ensure that > the above ksh call works properly ? Have you set WRDE_SHOWERR to see if anything prints to stderr? > On a second note, it is pretty messed up to have your C library > functions rely on ksh expansions. It really ought to go the other > way. POSIX Std 1003.2-1992, section E.9.9 (Rationale and Notes): While wordexp() could be implemented entirely as a library routine, it is expected that most implimentations will run a shell in a subprocess to do the expansion. wordexp() is not even close to what I would consdider a core C library routine, sh and ksh predate wordexp() considerably, and, given all the weird parsing they do, getting wordexp() into a form actually usable by the various shells would be next to impossible. In context, forking a shell to do shell word expansion is a reasonable implimentation, as the POSIX committee acknowledged. -- Dan Riley dsr@mail.lns.cornell.edu Wilson Lab, Cornell University "History teaches us that days like this are best spent in bed"