Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!decwrl!decvax!ucbvax!pasteur!ames!elroy!mahendo!steve From: steve@mahendo.Jpl.Nasa.Gov (3171) Newsgroups: comp.unix.questions Subject: Re: Shell commands (vi) from fortran etc. Message-ID: <154@mahendo.Jpl.Nasa.Gov> Date: 28 Feb 88 00:50:10 GMT References: <631@csm9a.UUCP> Organization: Jet Propulsion Labs, Pasadena, CA Lines: 7 From article <631@csm9a.UUCP>, by ngorelic@csm9a.UUCP (Noel Gorelick): > Anybody have any idea how I can invoke shell commands from > a fortran and_or C program? Particularly, vi, mv, and chmod. Use the system(3) call. You pass a string with the shell command in it, system(3) forks off a shell which executes the command and returns when the shell is done.