How to run an IDL code, which normally reads from the command line, from a script

E.g., (files can be found in ~bdavis/IDLtest/)

intest.pro contains:

   pro intest
      read, one
      read, two
      a = ' '
      read, a
      read, realnum
      print, one, two, ' ', a, realnum
   end

input.dat contains:
   1
   2
   a
   4.5 


callintest.pro contains
   ;;; COMMENTS:
   ;;;   usage:  IDL> @callintest
   ;;;    or
   ;;;           % idl calltest
   intest
   exit


To run:
   sunfire11% idl callintest < input.dat 

   IDL Version 5.3 (sunos sparc). (c) 1999, Research Systems, Inc.
   Installation number: 967-1.
   Licensed for use by: Princeton Plasma   Physics Lab

   % Compiled module: INTEST.
	 1.00000      2.00000 a      4.50000
 


Edited 16-Oct-2003 by: Bill Davis