-1

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.

  • Is that exactly the script you're running? How did it generate the `.d` at the end of the input file name shown in the error message? – lurker Oct 03 '13 at 02:12
  • You're right sorry. I had to key it in manually because the server I'm using is locked down pretty tight and I can't scp. Edited above. – Gërrit VanCøevering Oct 03 '13 at 14:01
  • I think the problem is the arrangement of quotes perhaps. You have `"tms96-fnl.go <./"${inpdir}"/inp"${j}"0"${i}".d> ./"${inpdir}"_out/out"${j}"0"${i}` which might be interpreted as a command that looks like `"tms96-fnl.go <./"`. I would try: `tms96-fnl.go < ./"${inpdir}"/inp"${j}"0"${i}".d > ./${inpdir}"_out/out"${j}"0"${i}"` – lurker Oct 03 '13 at 14:26

1 Answers1

0

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}"
lurker
  • 56,987
  • 9
  • 69
  • 103