Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ukma!tut.cis.ohio-state.edu!att!cbnews!r4
From: r4@cbnews.ATT.COM (richard.r.grady..jr)
Newsgroups: comp.bugs.sys5
Subject: Re: ksh bugs
Keywords: ksh
Message-ID: <9032@cbnews.ATT.COM>
Date: 16 Aug 89 21:30:53 GMT
References: <10166@fluke.COM> <2316@cbnewsc.ATT.COM> <2363@auspex.auspex.com>
Reply-To: r4@cbnews.ATT.COM (richard.r.grady..jr)
Distribution: na
Organization: AT&T Bell Laboratories
Lines: 41

In article <2363@auspex.auspex.com> guy@auspex.auspex.com (Guy Harris) writes:
>>Nor is it, as someone ludicrously suggested without checking, the here
>>document doing filename expansions, because the shell only does $ expansion
>>on here documents [unless the sentinel (EOF) is quoted, even partially
>>('EOF' or \EOF)], NOT ` or filename expansions.
>
>That may be true of filename expansion - I don't have a Korn shell handy
>to check - but it is definitely *not* true of ` expansions, which are
>referred to as "command substitution" in the Bourne shell manual page. 
>At least in the S5R3 Bourne shell, command substitution is performed in
>here documents.  (Try
>
>	$ sed 's/Wed/Wednesday/' << EOF
>	> `date`
>	> EOF
>
>I got "Wednesday Aug 16 10:15:53 PDT 1989" printed out.  This happened
>with both the Bourne and C shells.)

I do have access to a Korn shell, so I can confirm what Guy says
about command substitutions.
I tried the above sed command on two separate computers with Korn shell,
one running version 06/03/86a of ksh and the other version 11/16/88a.
In both cases, "Wed" was expanded to "Wednesday", showing that
the `date` was substituted OK.

Filename expansion, however, is not done:
        $ ls
        News
        a.out
        cls
        terms
        zzz.c
        $ cat << EOF
        > *
        > EOF
        *
        $

-------------------------------------------------------------------
Dick Grady              r_r_grady@att.com          ...!att!mvuxd!r4