exec statement to open an input file

From: A. Mahendra Rajah <Mahendra.Rajah_at_URegina.CA>
Date: Thu, 24 Mar 2005 15:37:43 -0600 (CST)

  When the I/O unit is a variable, the exec statement fails
  as follows:

        k=4
        set -xv
        exec ${k}< File25.dat
        + exec 4
        + 0< File25.dat
        ask.shl[11]: 4: not found

  How can one use variables in the exec statement to open files?

  Thanks,

  -- mahendra
.................................................................
   A. Mahendra Rajah Email: Mahendra.Rajah_at_URegina.CA
   Tru64 UNIX Systems Manager Phone: (306) 585-4496
   Dept. of Computing Services FAX: (306) 337-2324
   University of Regina,
   Regina, Sask., S4S 0A2
   Canada.
.................................................................
Received on Thu Mar 24 2005 - 21:43:42 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:45 NZDT