Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!uunet!auspex!guy From: guy@auspex.auspex.com (Guy Harris) Newsgroups: comp.unix.questions Subject: Re: How to issue a C SHELL command within a C program Message-ID: <3923@auspex.auspex.com> Date: 20 Aug 90 21:28:50 GMT References: <25279.26c7fd35@kuhub.cc.ukans.edu> <852@hls0.hls.oz> Organization: Auspex Systems, Santa Clara Lines: 14 >This works under SunOS 4.0.3 (and probably others): It should work on any UNIX system where "/bin/csh" refers to the C shell. (If it doesn't, either that system's C shell is broken, its "system()" implementation is broken, or something either or both of them use is broken.) > system("/bin/csh -c \"\""); > >system() calls /bin/sh, which in this case starts a `csh' to perform >. Note the \" around . Which means if *itself* contains double-quotes, you have some more quoting to do....