Shell commands (vi) from fortran etc.

3171 steve at mahendo.Jpl.Nasa.Gov
Sun Feb 28 10:50:10 AEST 1988


>From article <631 at csm9a.UUCP>, by ngorelic at 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.



More information about the Comp.unix.questions mailing list