Re: POSIX shell specification insight requested
On Tue, 2 Mar 2004 20:43:01 +0000, Colin Watson <cjwatson@debian.org> said:
> On Tue, Mar 02, 2004 at 12:47:15PM -0600, Manoj Srivastava wrote:
>> On Tue, 2 Mar 2004 13:04:43 -0500, Branden Robinson
>> <branden@debian.org> said:
>> > Is the following construction POSIXly correct? foo=$(cat <<EOF
>> > Foo bar baz quux. EOF)
>>
>> ======================================================================
>> ISO/IEC 9945-2:1993(E) Information Technology -- POSIX IEEE Std
>> 1003.2-1993 Part 2: Sheel and utilities
>>
>> § 3.6.3 Command substitution
>>
>> ...
>>
>> lines 474-477
>>
>> Within the $(command) form, all characters following the open
>> parenthesis to the matching closing parenthesis constitute the
>> /command/. Any valid shell script can be used for /command/, except
>>
>> -- A script consisting solely of redirections produces unspecified
>> results
>> ======================================================================
>>
>> The here document is a redirection, hence the reults of that
>> command substitution are unspecified.
> "cat <<EOF" is not "a script consisting solely of redirections". It
> contains a redirection, but does not consist solely of one.
I'll bite, Mr. bones. Please point out to dumb ol' me a single
statement in that script that is free of redirections. Or, if you
prefer POSIX syntax, please point me to a single "command" that is
free of redirection.
Oh, BTW, what POSIX considers a command is defined in sections
§3.9.1 (simple) and § 3.9.4 (compound). But I'm sure you knew that.
manoj
--
Alimony and bribes will engage a large share of your wealth.
Manoj Srivastava <srivasta@debian.org> <http://www.debian.org/%7Esrivasta/>
1024R/C7261095 print CB D9 F4 12 68 07 E4 05 CC 2D 27 12 1D F5 E8 6E
1024D/BF24424C print 4966 F272 D093 B493 410B 924B 21BA DABB BF24 424C
Reply to: