Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6346153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T20:57:45+00:00 2026-05-24T20:57:45+00:00

When I do this: $ /bin/echo 123 | /bin/echo I get no o/p. Why

  • 0

When I do this:

$ /bin/echo 123 | /bin/echo

I get no o/p. Why is that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T20:57:47+00:00Added an answer on May 24, 2026 at 8:57 pm

    You ask why it doesn’t work. In fact, it does work; it does exactly what you told it to do. Apparently that’s not what you expected. I think you expected it to print 123, but you didn’t actually say so.

    (Note: “stdin” is standard input; “stdout” is standard output.)

    /bin/echo 123 | /bin/echo

    Here’s what happens. The echo command is executed with the argument 123. It writes “123”, followed by a newline, to its stdout.

    stdout is redirected, via the pipe (|) to the stdin of the second echo command. Since the echo command ignores its stdin, the output of the first echo is quietly discarded. Since you didn’t give the second echo command any arguments, it doesn’t print anything. (Actually, /bin/echo with no arguments typically prints a single blank line; did you see that?)

    Normally pipes (|) are used with filters, programs that read from stdin and write to stdout. cat is probably the simplest filter; it just reads its input and writes it, unchanged, to its output (which means that some-command | cat can be written as just some-command).

    An example of a non-trivial filter is rev, which copies stdin to stdout while reversing the characters in each line.

    echo 123 | rev
    

    prints

    321
    

    rev is a filter; echo is not. echo does print to stdout, so it makes sense to have it on the left side of a pipe, but it doesn’t read from stdin, so it doesn’t make sense to use it on the right side of a pipe.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a script that looks like this #!/bin/bash function something() { echo hello
For testing purposes I have this shell script #!/bin/bash echo $$ find / >/dev/null
Is there a less brute-force way to do this? #!/bin/ksh THIS_SCRIPT=$(/usr/bin/readlink -f $(echo $0
If I have a folder structure that looks like this: / /bin/myComponent.cfc /reports/index.cfm How
Why can't the folder be found? I double checked that it exists. #!/bin/bash echo
I am trying this option #!/bin/ksh echo $1 awk '{FS==;print $2}' $1 and on
Running this prints out both statements #!/bin/bash echo Hello && echo World However, running
This is what I'm doing: import org.apache.commons.exec.*; String cmd = /bin/sh -c \echo test\;
Let's say I've got a shell script called print_error.sh looking like this: #!/usr/bin/bash echo
I have a simple script named example : #!/bin/sh echo $'${1}' Please note that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.