Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Why doesn't this command output "1"?

echo 1 | echo

I imagine it working this way:

1. echo 1 (outputs 1)
2. | echo (takes the 1 as an input, then echos it)

Isn't this what should happen?

share|improve this question

migrated from stackoverflow.com Nov 19 '11 at 1:49

This question came from our site for professional and enthusiast programmers.

echo doesn't use stdin, try using cat

echo 1 | cat


echo 1 | xargs echo
share|improve this answer

Your Answer


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