[問題] fortran read

看板Linux作者 (feynman511)時間13年前 (2012/10/16 09:47), 編輯推噓1(102)
留言3則, 3人參與, 最新討論串1/1
想問一點fortran 的問題 在shell script裡面 主程式(command) 後面接的字串 內定就叫$1 $2 ...etc 所以 可以用這樣的方式給shell script 的程式當作input 那請問fortran可以嗎? 也就是 $./a.out cmd 以cmd作為 a.out的輸入字串 當fortran 裡面寫 read(*,*)的時候 實際的執行會是跑到下一行 在讓終端機輸入 有試過 $./a.out < cmd 可是回應是 cmd: No such file or directory 請問有辦法用指令後面的字串給fortran 輸入嗎? 謝謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 108.224.49.149

10/16 10:18, , 1F
搜尋 fortran command line argument 會有一些資料
10/16 10:18, 1F

10/16 10:30, , 2F
謝謝 有找到了 不過google說 要fortran 2003以後的才支援
10/16 10:30, 2F

10/19 00:19, , 3F
http://goo.gl/gZWhV "$" dollar sign
10/19 00:19, 3F
文章代碼(AID): #1GVBosZ2 (Linux)