X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 01 Sep 2022 04:07 PM by  johnbkim
Endfor syntax error when scripting with bash shell
 2 Replies
Sort:
You are not authorized to post a reply.
Author Messages

johnbkim



New Member


Posts:1
New Member


--
30 Aug 2022 10:13 AM
    I have a script like this in a bash shell script

    idl << end_of_commands
    print, 1
    print, 2
    ...
    print, 1000
    end_of_commands

    And it works fine. Then I rewrote it to have this form:

    idl << end_of_commands
    for i=1,1000 do begin
    print,i
    endfor
    end_of_commands

    And when I run it IDL says:

    endfor
    ^
    % Syntax error.

    Thank you.

    Ben Castellani



    Basic Member


    Posts:130
    Basic Member


    --
    31 Aug 2022 09:34 AM
    Try doing something like this:

    idl << end_of_commands
    for i=1,1000 do begin $
    print,i & $
    endfor
    end_of_commands

    johnbkim



    New Member


    Posts:1
    New Member


    --
    01 Sep 2022 04:07 PM
    That worked!
    Thanks!!!
    You are not authorized to post a reply.