
System commands and command-line args with g77 on Sun
Does anyone have experience using system command and command-line
arguments using fortran with g77 on a Sun workstation? Any help
will be appreciated.
Using DOS and MS Fortran 5.1 the code was:
1) system commands
INTERFACE TO INTEGER*2 FUNCTION SYSTEM [C]
& (STRING[REFERENCE])
CHARACTER*1 STRING
END
PROGRAM MAIN
INTEGER*2 I,SYSTEM
I=SYSTEM("system_command")
END
This was useful for spawning an EXE or listing a directory.
2) command line args
PROGRAM MAIN
CHARACTER*80 PATHX,INPUT
INTEGER*2 IP,IPX
CALL GETARG(0,PATHX,IPX) ! EXE path
CALL GETARG(1,INPUT,IP) ! 1st command-line input
END
Thanks
Nigel