comp.lang.idl-pvwave archive - RDF feed
type: channel
description: Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
items: idl print call
items: Re: idl print call

idl print call
type: item
description: Hey! I am running an IDL procedure that is called several times from a bash script, each time with varying parameters. The output of each call is written to a separate file. Is it possible to write at the beginning of the output file the call itself? I use the time stamp in the file name to discern the different calls, but it is annoying to check the time stamps each time to know which file belonges to which call... best, Audrey
creator: audrey.schaufelberger
date: 2017-03-26T12:32:01-00:00

Re: idl print call
type: item
description: On 03/26/2017 02:32 PM, audrey.schaufelberger@gmail.com wrote: > I am running an IDL procedure that is called several times from a > bash script, each time with varying parameters. The output of each > call is written to a separate file. > > Is it possible to write at the beginning of the output file the call > itself? I use the time stamp in the file name to discern the > different calls, but it is annoying to check the time stamps each > time to know which file belonges to which call... Hi Audrey I don't think there is a general way to do retrieve the file call, some foreknowledge is required. From within IDL it is probably not possible to know how you capitalized the name of the procedure you started, whether you passed your arguments by e.g. '-arg aaa -arg bbb' or '-args aaa bbb', and in general it won't be possible to know what your arguments were before shell expansion. Furthermore, IDL won't know whether you nice'd the call or whether you piped the output to a log, and some other things I probably missed. Knowing what your bash script does should make it rather easy to construct the call from the list of arguments. How to get to the list of arguments should become clear when reading the procedure below, some easy examples of probable calls are included too. Should you really need the actual call without using any foreknowledge, use spawn, 'history', out and then parse out . I hope that helps, Markus for demonstration purposes enter in bash: idl -e procedure_fromBash -args test one two idl -e "procedure_fromBash, ['test','one','two']" echo "test" > args4IDL echo "one" >> args4IDL echo "two" >> args4IDL idl -e procedure_fromBash rm args4IDL ;;; file procedure_frombash.pro ;;;------------------------------------- pro procedure_fromBASH, argsFromBash n=n_elements(argsFromBash) if n eq 0 then print, $ 'procedure_fromBASH has not been passed an argument' else begin print, 'procedure_fromBASH has as argument a ' help, argsFromBash print, 'which contains:' for i=0,n-…
creator: Markus Schmassmann
date: 2017-03-27T11:26:31-00:00

Re: idl print call
type: item
description: On 03/26/2017 02:32 PM, audrey.schaufelberger@gmail.com wrote: > I am running an IDL procedure that is called several times from a > bash script, each time with varying parameters. The output of each > call is written to a separate file. > > Is it possible to write at the beginning of the output file the call > itself? I use the time stamp in the file name to discern the > different calls, but it is annoying to check the time stamps each > time to know which file belonges to which call... or for short: spawn, 'ps -p $(ps -p $$ -o ppid --no-heading) -o cmd --no-heading', out print, out see: https://ss64.com/bash/ps.html
creator: Markus Schmassmann
date: 2017-03-27T12:15:13-00:00