Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!pacbell.com!news.arc.nasa.gov!haven.umd.edu!ni.umd.edu!sayshell.umd.edu!louie From: louie@sayshell.umd.edu (Louis A. Mamakos) Newsgroups: comp.sys.next Subject: Re: system calls from objective-C Message-ID: <1991Jun22.214905.24958@ni.umd.edu> Date: 22 Jun 91 21:49:05 GMT References: <1991Jun15.001049.23391@cs.mcgill.ca> <2192@kgw2.XETRON.COM> Sender: usenet@ni.umd.edu (USENET News System) Organization: University of Maryland, College Park Lines: 30 Nntp-Posting-Host: sayshell.umd.edu In article scott@mcs-server.gac.edu (Scott Hess) writes: >In article <2192@kgw2.XETRON.COM> dennisg@kgw1.xetron.COM (Dennis Glatting) writes: > >This could bring in a whole slew of related circumstances. For >instance, system(3) should use your default shell, so the ~/.cshrc >(or ~/.profile) should be sourced. Please! No! No! Not that! There is a reason that system and 'make' use the Bourne shell: to get predictable behavor. For instance, suppose that I want to invoke a program with the system(3) library routine, and I want to redirect its standard output AND standard error into a file. How do I do this? From the Bourne shell, I'd do something like this: /foo/bar/my/program > output 2>1 but from the C-shell, I'd do this instead: /foo/bar/my/program >& output How am I, the application writer that wants to use the system routine supposed to know what to use? I suppose that I could look at the environment variable, but then I'd have to know how each and every weird shell that exists is supposed to work, which meta-characters do what, and who knows what else! Right now I *know* for certain that the Bourne Shell is being invoked to do this stuff, and can write code accordingly. louie