Save command line output to variable in Fortran
问题 Is there a way to store the output of a command line utility to a variable in Fortran? I have a BASH based utility which gives me a number which needs to be used in a Fortran program. I want to call the utility through the program itself, and avoid writing the output to a file if possible. Something like this maybe? integer a write(a,*) call execute_command_line('echo 5') Or like this maybe? read(call execute_command_line('echo 5'),*) a I don't think either of these is right though. I would