Re: IDL and BASH scripts [message #68300 is a reply to message #68227] |
Tue, 13 October 2009 07:36   |
Paul Van Delst[1]
Messages: 1157 Registered: April 2002
|
Senior Member |
|
|
nata wrote:
> Hi guys,
>
> I wrote a script to help me with the most common actions I always do
> in IDL. I copy some folders, I update some files and finally I call
> IDL to do some actions.
> Normally I use something like this:
>
> idl <<!here
> some_actions
> @my_program.pro
> resolve_all
> save, filename='my_program.sav', /routines
> exit
> !here
>
> It works good but I've a problem if I try to run this code inside a
> case statement. My idea is to execute this code as an optional
> argument for my script. When I try to do it I've an error:
> here-document at line 127 delimited by end-of-file (wanted `!here')
> unexpected end of file
>
> I don't understand the error and I don't know if there are more
> options to call IDL and do some actions from a BASH script. Can
> anybody help ? Thanks,
Are you indenting in the case statement? If so, the "!here" won't be recognised if there
is whitespace in front of it.
If that is the case (no pun intended), in your script if you do something like
idl <<-NoMoreInput
some_actions
@my_program.pro
resolve_all
save, filename='my_program.sav', /routines
exit
NoMoreInput
i.e. put the "-" between the "<<" and end-of-file marker, you can tab in.
I also agree with pp on the use of "!here" as an eof marker - apart from any issue with
the ! character, it doesn't really explain what it does. But, that's just my personal
preference (I tend to be verbose in code :o).
Anyway, HTH.
cheers,
paulv
|
|
|