ksh bugs

richard.r.grady..jr r4 at cbnews.ATT.COM
Thu Aug 17 07:30:53 AEST 1989


In article <2363 at auspex.auspex.com> guy at 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 at att.com          ...!att!mvuxd!r4 



More information about the Comp.bugs.sys5 mailing list