[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: try to open file descriptor for input with 'exec' fails
From: |
Chet Ramey |
Subject: |
Re: try to open file descriptor for input with 'exec' fails |
Date: |
Mon, 05 Nov 2007 09:19:55 -0500 |
User-agent: |
Thunderbird 2.0.0.6 (Macintosh/20070728) |
juergen@kaesman.de wrote:
> Bash Version: 3.2
> Patch Level: 25
> Release Status: release
>
> Description:
> In the following script i try to open a free file
> descriptor for input from a file.
> The script should read lines out of a textfile,
> output goes to stdout.
> This works fine till my last SUSE Linux 10.1 (sorry
> I don't know the version of the bash).
> But now (opensuseLinux 10.3) the script aborts with
> following error message:
>
> ./doit: line 29: exec: 3: not found
>
> This is the line where i try to open the file descriptor
> for input:
> exec ${fd}<$inf
That form of redirection construct is not parsed the way you
are assuming. The shell grammar has always required a number
before the `<' or `>' to specify a particular file descriptor.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
Live Strong. No day but today.
Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/