comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » IDL help?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
IDL help? [message #92497] Thu, 31 December 2015 23:26 Go to next message
Sapna Mishra is currently offline  Sapna Mishra
Messages: 66
Registered: December 2015
Member
Hello every one,
I am trying to make a shell script in which i want my script to call an IDL function which return a value in a variable , and i want to use the value of that variable into my rest of the script. Is there any way to that? Basically i want to connect my shell script and idl function together. Any help??
Re: IDL help? [message #92501 is a reply to message #92497] Fri, 01 January 2016 14:05 Go to previous messageGo to next message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On 1/1/16 12:26 AM, Sapna Mishra wrote:
> Hello every one, I am trying to make a shell script in which i want
> my script to call an IDL function which return a value in a variable
> , and i want to use the value of that variable into my rest of the
> script. Is there any way to that? Basically i want to connect my
> shell script and idl function together. Any help??
>

You can use the EXIT routine to return an error code. Or you can pipe
stdout to a variable -- though you are going to have to start IDL with
-quiet, like:

$ var=$(idl -quiet -e "print, 5")
$ echo $var
5

Mike
--
Michael Galloy
www.michaelgalloy.com
Modern IDL: A Guide to IDL Programming (http://modernidl.idldev.com)
Re: IDL help? [message #92502 is a reply to message #92497] Fri, 01 January 2016 20:48 Go to previous messageGo to next message
Sapna Mishra is currently offline  Sapna Mishra
Messages: 66
Registered: December 2015
Member
Ok if i have a function say fun.pro and i want its value to be store in var and send it to shell script how it would be look like????
Thanks for your previous help.....
Re: IDL help? [message #92503 is a reply to message #92502] Fri, 01 January 2016 20:50 Go to previous messageGo to next message
Sapna Mishra is currently offline  Sapna Mishra
Messages: 66
Registered: December 2015
Member
Ok if i have a function say fun.pro and i want its value to be stored in var and send it to shell script how it would be look like????
Thanks for your previous help.....
Re: IDL help? [message #92505 is a reply to message #92502] Sat, 02 January 2016 07:48 Go to previous messageGo to next message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On 1/1/16 9:48 PM, Sapna Mishra wrote:
> Ok if i have a function say fun.pro and i want its value to be store
> in var and send it to shell script how it would be look like????
> Thanks for your previous help.....
>

If fun.pro contains a function called FUN, you could do something like:

$ var=$(idl -quiet -e "result = fun() & print, result")

Or you could just have FUN print its output instead of returning a
value. In any case, if you are doing this, make sure to remove other
PRINT statements from your code.

Mike
--
Michael Galloy
www.michaelgalloy.com
Modern IDL: A Guide to IDL Programming (http://modernidl.idldev.com)
Re: IDL help? [message #92506 is a reply to message #92497] Sat, 02 January 2016 08:26 Go to previous messageGo to next message
Sapna Mishra is currently offline  Sapna Mishra
Messages: 66
Registered: December 2015
Member
var=$(idl -quiet -e "result = fun(2,3) & print, result")
It worked thanku so much for your time.
Re: IDL help? [message #92507 is a reply to message #92497] Sat, 02 January 2016 08:27 Go to previous message
Sapna Mishra is currently offline  Sapna Mishra
Messages: 66
Registered: December 2015
Member
var=$(idl -quiet -e "result = fun(2,3) & print, result")

It worked.... Thank you so much for your time.....
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: DLM for video capture
Next Topic: FL ARMed!

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 11:31:50 PDT 2025

Total time taken to generate the page: 0.00448 seconds