Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

The grml zsh configuration contains a zsh abbreviation for a command I have never seen before:

abk=(
#   key   # value                  (#d additional doc string)
#A# start
    # <snipped>
    'G'    '|& grep --color=auto '

I am wondering why the abbreviation G expands to |& and not |. So the question is:

What is the difference between |& and |?

share|improve this question
    
It can be searched for in man zshall by entering /\|&. The pipe needs to be escaped. –  Daniel Beck Oct 19 '12 at 12:04

1 Answer 1

up vote 3 down vote accepted

|& is short form for 2>&1 | – it redirects both stdout and stderr over the pipe.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.