Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • Your redirect is wrong, you need to redirect STDERR after STDOUT, since it does dup2(2, 1) which is still your terminal if you do it before.

    $ (echo foo >&2) 2>&1 >/dev/null
    foo
    $ (echo foo >&2)  >/dev/null 2>&1
    $
    • Bah, I misread, I thought you wanted STDERR to go to /dev/null, not to cat's STDIN. Sorry.
  • Uh... wouldn't "2>&1 >/dev/null" just put what's going to stderr to stdout and what's going to stdout to nothing, as opposed to both stderr and stdout to nothing?

    I think you need "2>/dev/null" for what you want.

    --
    The new Strawberry Perl for Windows has been released! Check http://strawberryperl.com for it.
    • Uh... wouldn't "2>&1 >/dev/null" just put what's going to stderr to stdout and what's going to stdout to nothing, as opposed to both stderr and stdout to nothing?

      Yes.

      I think you need "2>/dev/null" for what you want.

      No. :-)

      I'm relying on the order of parsing of pipes and redirection. git fetch -q 2>&1 >/dev/null </dev/null | cat is parsed as run this:

      git fetch -q 2>&1 >/dev/null </dev/null

      piped to that:

      cat

      Then, git fetch -q 2>&1 >/dev/null </dev/null is

      • Sorry. Misunderstood what you meant, then. Better answers are below.
        --
        The new Strawberry Perl for Windows has been released! Check http://strawberryperl.com for it.
  • -qq, though I'm not sure exactly where that's supposed to be documented.
  • This just works as expected with single -q on git 1.6.4 (and doesn't on 1.5.2.1).

    Time to upgrade... :-)