in reply to open won't die

... I didn't think that quote (') was a shell metacharacter and it's not listed in the bash manpage as one.

Okay, technically, quotation marks are not called "metacharacters" in the bash man page -- the first thing you find is this:

DEFINITIONS
 ...
 metacharacter
      A  character  that, when unquoted, separates words.
      One of the following:
      |  & ; ( ) < > space tab
But then farther down (way farther -- bash has a big man page), there's a whole "chapter" called QUOTING, which makes it clear that single and double quotes have special (distinct) meanings in shell commands. It's this notion of "having special meaning to the shell" that defines the set of things counted as "metacharacters" in a pipeline command string that you pass the perl's open() call. Granted, the terminology is a little slippery here.

Replies are listed 'Best First'.
Re: Re: open won't die
by YuckFoo (Abbot) on Oct 28, 2003 at 23:45 UTC
    Thanks graff,

    With some thought I realized it doesn't matter what the sh or bash consider metacharacters, its what Perl considers metacharacters that counts.

    From perldoc -f quotemeta, its: "all char­acters not matching '/A-Za-z_0-9/' "

    YuckFoo

      What's considered a character special to the shell is *not* the same as all characters not matching /[A-Za-z_0-9]/. This is immediately obvious from the example of the OP. Both examples contain a space, a space is not matched by /[A-Za-z_0-9]/, yet in one case the shell is called, in another it isn't.

      Here's another example:

      $ perl -wle 'exec ", foo" or die' Can't exec ",": No such file or directory at -e line 1. Died at -e line 1.
      No shell called, even with a comma present.

      Abigail