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

Home » Public Forums » archive » Re: Capturing screen output
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Capturing screen output [message #28086] Tue, 20 November 2001 14:21 Go to previous message
Liam E. Gumley is currently offline  Liam E. Gumley
Messages: 378
Registered: January 2000
Senior Member
David Shadovitz wrote:
>
> I'm running IDL 5.4 on a Sun.
>
> I've got a file, cpsub1, which looks like this:
>
> $ cat cpsub1
> echo "computePPP, /batch, inputfile='abc.hdf'" | idl
>
> If I run it by simply typing cpsub1 at the command line, all of the IDL
> messages and PRINT statement outputs are sent to the screen:
>
> $ cpsub1
> % Compiled module: MODULE1
> % Compiled module: MODULE2
> % Compiled module: MODULE3
> Entered main routine...
> Computing the power...
> Done.
> $
>
> I'd like to capture that information in a log file, so I tried
> redirecting standard output, like this:
>
> $ cat cpsub2
> echo "computePPP, /batch, inputfile='abc.hdf'" | idl > cplog2
>
> $ cpsub2
> % Compiled module: MODULE1
> % Compiled module: MODULE2
> % Compiled module: MODULE3
> $
>
> As you can see, now only the IDL messages are written to the screen.
> But the PRINT statement outputs aren't sent to the log file! Upon
> completion, cplog2 is a 0-byte file.
>
> Then I tried redirecting both standard output and standard error:
>
> $ cat cpsub3
> echo "computePPP, /batch, inputfile='abc.hdf'" | idl > cplog3 2>&1
> $ cpsub3
> $
>
> Now nothing is written to the screen. But neither is it going to the
> log file! Upon completion, cplog3 is a 0-byte file.
>
> Can anyone help me capture the IDL messages and the PRINT statement
> output into a file? I'm running my code in this odd manner because
> ultimately I want to run the job in batch mode via 'ssub'.

David,

The following method works for me (I normally use the C shell):

#---cut here---
#!/bin/csh -f

# Sample script to execute IDL in batch mode

# Create IDL run script
echo "print, 'Hello world'" > runidl
echo "exit" >> runidl

# Run IDL
/usr/local/bin/idl runidl >& runidl.out
#---cut here---

You may need to adjust the last line if IDL is installed in a
non-default directory.

Cheers,
Liam.
Practical IDL Programming
http://www.gumley.com/
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Structure assign question
Next Topic: Re: can i place a job advert

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

Current Time: Thu Oct 09 02:58:56 PDT 2025

Total time taken to generate the page: 1.19989 seconds