Unix command line arguments to IDL program? [message #17173] |
Tue, 14 September 1999 00:00  |
Craig Hamilton
Messages: 28 Registered: December 1996
|
Junior Member |
|
|
Hi all:
How can I do the following:
Say I have a file xyz.dat with some interesting information in it,
and I have an IDL program, idlinfo.pro, that will read that file and
show me that interesting information. I want to type
the following at a Unix prompt and have the IDL program
startup and show me the info in file xyz.dat:
% showinfo xyz.dat
I realize (I think) that "showinfo" must be a script and so far I've
come up with the following script that will
start up my IDL program, idlinfo.pro :
#!/bin/csh
echo 'idlinfo' | idl
Now the problem is to get the filename xyz.dat to the
IDL program somehow. So far, all I've come up with
is writing a temp file into /tmp that idlinfo.pro is looking
for. There has got to be a better way.
Someone please enlighten me.
Thanks,
Craig
-Craig A. Hamilton,PhD cah@medeng.wfubmc.edu
-Wake Forest Univ. School of Medicine
-Dept. of Med. Engr. / MRI Center
-Medical Center Blvd.
-Winston-Salem, NC 27157-1022
-(336)716-2819 [FAX: 2870] [Secr: 6890]
|
|
|
Re: Unix command line arguments to IDL program? [message #17277 is a reply to message #17173] |
Thu, 16 September 1999 00:00  |
Craig Hamilton
Messages: 28 Registered: December 1996
|
Junior Member |
|
|
Axel vom Endt wrote in message <37DEB029.17E7ADCC@bu.edu>...
> Craig Hamilton wrote:
>
>> I want to type
>> the following at a Unix prompt and have the IDL program
>> startup and show me the info in file xyz.dat:
>>
>> % showinfo xyz.dat
>>
>
> I'd use a script like
>
> #!/bin/csh
> idl << EOF
> idlinfo $1
> EOF
>
>
> Hope that helps
>
> Axel
Thanks, Axel! That's just what I needed. Just needed to add
a little punctuation to your script, and I'm on my way....
#!/bin/csh
idl << EOF
idlinfo, '$1'
EOF
|
|
|