perl does not treat # inside `` properly
:
: The perl language is supposed to provide shell syntax equivalence
: within the `` characters.
More specifically, it's supposed to provide Bourne shell syntax equivalence.
: However I have seen that the # character
: even within `` is not treated equivalently. e.g.
Perl has nothing to do with that. You'd have the same problem with
that command in a shell script. You're getting away with it on the
command line because when the Berkeley hacked in '#' as a comment
character in csh, they disabled that feature when the the shell was
running interactively. Neither Bourne shell nor csh let you get away
with that when running non-interactively.
Try the following:
Running sh
$ echo hi # there
hi
$
Running csh interactively
% echo hi # there
hi # there
%
Running csh non-interactively
% echo "echo hi # there" >/tmp/foo
% csh /tmp/foo
hi
%
Bourne shell is a MUCH more consistent beastie than csh. All
reasonable C implementations of system() and popen() call out to
/bin/sh. So do some unreasonable ones, like Perl. :-)
Larry