質問

My current project involves the use of a .go executable written on Fortran 77 in the mid-eighties. My only access to it currently is through ssh to a server using csh. I have written the following script:

set inpdir = $argv[1]
mkdir ${inpdir}"_out"
set j = 1
while ($j <= 5)
    set i = 0
    while ($i <= 20)
        "tms96-fnl.go <./"${inpdir}"/inp"${j}"0"${i}".d> ./"${inpdir}"_out/out"${j}"0"${i}
        set i = i + 1
    end
    set j = j + 1
end

The result is the message:

tms96-fnl.go <./fftf/inp100.d> ./fftf_out/out100 -Command not found
Syntax error

If i were to key the contents of that message (sans the "-Command not found") while in the same working directory as the script it executes as expected.

役に立ちましたか?

解決

The problem is the arrangement of quotes. You have:

"tms96-fnl.go <./"${inpdir}"/inp"${j}"0"${i}".d> ./"${inpdir}"_out/out"${j}"0"${i}

Which would interpret a command that looks like tms96-fnl.go <./. I would do:

tms96-fnl.go < ./"${inpdir}"/inp"${j}"0"${i}".d > ./"${inpdir}"_out/out"${j}"0"${i}"
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top