How to run command line scripts from within Fortran 90

  • #1
Hey!

I'm currently making a program which is a three body problem. I managed to get working results which I can plot to gnuplot. The question is, how can I write this within the program itself, so it can automatically plot the information to gnuplot if the user wants it to? (I'm being lazy :P)

I know I have to create a script, which I have done, but I don't know the function in Fortran 90 which will allow me to call it and then run it automatically. I believe there is a function along the lines of get_command_argument (I tried this but it isn't a function) or something similar to that.

Thank you for the help!
AlphaBetaGamma96
 

Answers and Replies

  • #4
jim mcnamara
Mentor
4,009
2,445
When you do this on UNIX be sure to include a shebang as the very first line first column of your script. This makes the script run with /bin/whatevershell rather than /bin/sh. Which is the default whenever no shell is specified. Example:
Code:
#!/bin/bash
runs the bash shell to execute the script
 

Related Threads on How to run command line scripts from within Fortran 90

Replies
6
Views
14K
Replies
3
Views
1K
Replies
1
Views
3K
  • Last Post
Replies
4
Views
4K
  • Last Post
Replies
7
Views
5K
Replies
5
Views
1K
  • Last Post
Replies
4
Views
2K
Replies
4
Views
5K
Replies
7
Views
4K
Top