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 8047743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T06:11:45+00:00 2026-06-05T06:11:45+00:00

Consider the following example Bash one-liner in which the letters h, e and o

  • 0

Consider the following example Bash one-liner in which the letters “h”, “e” and “o” are removed from the word “hello” one at a time, in that order. Only the two “l” letters remain;

$ echo "hello" | tr -d h | tr -d e | tr -d o
ll

I am trying to find a method for displaying the output of each command to the screen within the one liner, so others running it can see what is going on. Continuing with the above example I would like output as follows;

$ echo "hello" | tr -d h | tr -d e | tr -d o
hello
ello
llo
ll

Is this possible? As per the operation of the one-liner above, we are carrying the output from command to command with the vertical pipe. So I assume I would have to break from the pipe to print to stdout, which would then interrupt the “command chain” I have written. Or perhaps tee can be used here, but I can’t seem to achieve the desire affect. UPDATE: tee won’t work because it’s output is still within the boundaries of the pipe, duh!

Many thanks.

  • 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-06-05T06:11:46+00:00Added an answer on June 5, 2026 at 6:11 am

    This only works on a terminal:

    echo hello  | tee /dev/tty |
        tr -d h | tee /dev/tty |
        tr -d e | tee /dev/tty |
        tr -d o
    

    The /dev/tty device redirects output to the current terminal, no matter where the normal output goes.

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

Sidebar

Related Questions

consider the following example. I have to select all the records from table1 which
Please consider the following example code (from the lm doc): ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14) trt
Consider the following example from APUE book: #include <errno.h> #include <sys/socket.h> int initserver(int type,
Consider the following example taken from http://www.albahari.com/threading/ : using System; using System.Threading; class ThreadTest
Consider the following example quoted from php manual for DateTime <?php $date = new
As an example consider the following bash script. There are two loops, the first
Please consider following example: The source image consists of 6 areas that need to
I'm having a hard time understanding this. Consider the following example: protected void Page_Load(object
Consider the following example : HTML: <div class=wrapper> <div class=left>Some text here</div><div class=right>Hello Stack
Consider the following example which should color every second row: ( live demo here

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.