X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 27 Jul 2009 01:59 PM by  anon
Bash Scripting .pro files
 3 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
27 Jul 2009 01:59 PM
    *******Note: I think that I might have posted this originally in a defunct forum as I was the only thread, sorry if this is a double post everybody. I am attempting to make a script that runs a set of idl commands to simplify a long complicated process thats I perform weekly. What I usually do is in terminal $ idl IDL > .r glmutlsmaps.pro IDL > maps, dayrange='2009d100' IDL > exit (where maps is the header of the profile I just compiled and dayrange is a variable in the file) Now, what I was thinking of doing in my bash script was idl -e ".r glmutlsmaps.pro" idl -e "maps, dayrange='2009d100'" , but this doesn't work because you have to compile the pro file: $ idl -e ".r glmutlsmaps.pro" IDL Version 6.3 (linux x86 m32). (c) 2006, Research Systems, Inc. Installation number: 29XXX. Licensed for use by: JXXXXXXXXXXXXX % Compiled module: MAPS. $ idl -e "maps,dayRange='2009d100'" IDL Version 6.3 (linux x86 m32). (c) 2006, Research Systems, Inc. Installation number: 29XX. Licensed for use by: JXXXXXXXXXXXXX % Attempt to call undefined procedure/function: 'MAPS'. % Execution halted at: $MAIN$ Any help would be much appreciated, Is there some way of getting both commands to execute in sequence in a single session of idl from bash script? -Daniel

    Deleted User



    New Member


    Posts:
    New Member


    --
    31 Jul 2009 01:50 AM
    Hi, I would expand the default IDL !path variable to include the path of your ".pro" files as the following example : !PATH = !PATH + ':' + EXPAND_PATH('+/home/users/username/Desktop/IDL/pro/') This instruction must be implemented into your script after the IDL started command ($idl). Patrice.  

    Deleted User



    New Member


    Posts:
    New Member


    --
    21 Aug 2009 05:44 PM
    Thanks Patrice, Sadly this doesn't seem to have fixed things, I get   idl -e ".r glmutlsmaps.pro" % Compiled module: MAPS. idl -e "!PATH = !PATH +':'+EXPAND_PATH('+/nas/users/me/Programs/')" PATH: Event not found. but  I seem to get no error when I run it directly from the command line. Despite this when I quit  IDL and try to run it then nothing seems to have happened and I get the same errors. print,!PATH shows that my path has been added, but when I quit  and come back it seems to have been deleted. How do I get it to not be temporary? Actually, just in general, because I am curious how this works, does !path serve as a direction to compiled IDL code? So once IDL compiles the .pro file it sits there and waits to be called?  Otherwise idl -e seems like a kind of useless command. Thanks so much for your help, -Daniel

    Deleted User



    New Member


    Posts:
    New Member


    --
    24 Aug 2009 06:31 AM
    Hi Daniel, Please, read the following procedure:   Step 1: I suggest you to create a file with some idl commands (idlcommandsfile.com) ;First line of your IDL commands file !PATH = !PATH +':'+EXPAND_PATH('+/nas/users/me/Programs/') .r  glmutlsmaps.pro ;Last line of your IDL commands file Step 2: I suggest you to create your script file as the following simply example : (This file is used to launch IDL and to execute the IDL commands of the idlcommandsfile.com file) # commentary : first line of your script file #!/bin/csh /usr/local/bin/idl "/path/"idlcommandsfile.com #  commentary : last line of your script file I  used such procedure many times with good results... Best regards. Patrice.
    You are not authorized to post a reply.