NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: standards/40554



The following reply was made to PR standards/40554; it has been noted by GNATS.

From: Alan Barrett <apb%cequrux.com@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: standards/40554
Date: Thu, 5 Feb 2009 20:51:51 +0200

 On Thu, 05 Feb 2009, Valeriy E. Ushakov wrote:
 >  So, what's incorrect about the current wording?
 
 Our sh(1) man page implies that the n1 and n2 in [n1]>&n2 must be
 literal numbers.  My tests suggest that n1 must be a literal number, but
 n2 may be the result of variable substitution, or command substitution.
 
 For example, this works:
 
        n2="-"
        exec 2>&${n2}   # same as exec 2>&-
 
 and so does this:
 
        n2="1"
        exec 2>&${n2}   # same as exec 2>&1
 
 but this fails:
 
        n1="2"
        exec ${n1}>&1   # searches for "2" in $PATH, which probably fails
 
 --apb (Alan Barrett)
 


Home | Main Index | Thread Index | Old Index