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

Home » Public Forums » archive » SHELL+IDL bridge.
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
SHELL+IDL bridge. [message #92896] Fri, 18 March 2016 04:52 Go to next message
Sapna Mishra is currently offline  Sapna Mishra
Messages: 66
Registered: December 2015
Member
Hello all,

I have a bash script , in which I want to read a file using IDL

IDL COM: ftab_print,'FORS1_B_GRS_600V_94_GG375_30.fits',[1,5,6],texto ut='tt.txt'

then I want to run these bash commands inside my script:

disp=( $(awk '{print $1}' ./tt.txt) )

start=( $(awk '{print $2}' ./tt.txt) )

end=( $(awk '{print $3}' ./tt.txt) )

Also I want to call IDL functions in this script. Anyone can help me out?

when I am running my script: bash script.bash
i get error:


% Syntax error.
bash: -c: line 0: unexpected EOF while looking for matching `)'

My all script:

#!/bin/bash
idl <<!here
.rnew CLASSIFICATION.pro
.rnew NEWFILE.pro

ftab_print,'FORS1_B_GRS_600V_94_GG375_30.fits',[1,5,6],texto ut='tt.txt'

spawn, 'disp=( $(awk '{print $1}' ./tt.txt) )'

spawn, 'start=( $(awk '{print $2}' ./tt.txt) )'

spawn, 'end=( $(awk '{print $3}' ./tt.txt) )'

spawn, 'esorex fors_science --dispersion=${disp[1]} --resp_fit_degree=2 --startwavelength=${start[1]} --endwavelength=${end[1]} sci.sof'

exit
Re: SHELL+IDL bridge. [message #92901 is a reply to message #92896] Fri, 18 March 2016 09:34 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
On Friday, March 18, 2016 at 7:52:49 AM UTC-4, Sapna Mishra wrote:
> Hello all,
>
> I have a bash script , in which I want to read a file using IDL
>

You have some serious issues, but they are mostly BASH related and mostly not related to IDL.

Issue 1: your !here document doesn't end
Issue 2: substitution is not working in the order you think it does. Instead of sending the script to IDL directly, send it to a file and see what comes out. You will be surprised what is missing.
Issue 3: your use of single quotes in the SPAWN statements are potential syntax errors. Within IDL you cannot embed single quotes within a single-quoted string like you did. This "string 'single'" is OK but 'string 'single'' is not.

Craig
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Take values from several arrays with nearest neighbour matching
Next Topic: error in cgWindRose code

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

Current Time: Wed Oct 08 15:06:17 PDT 2025

Total time taken to generate the page: 0.00509 seconds