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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T10:02:39+00:00 2026-05-21T10:02:39+00:00

Revised version of question: cat – | tr a-z A-Z | tr A-Z a-z

  • 0

Revised version of question:

cat - | tr "a-z" "A-Z" | tr "A-Z" "a-z"

does not give any output when I run it on my bash shell prompt. I have to press Ctrl-D to get the o/p.

o/p

$ cat - | tr "a-z" "A-Z" | tr "A-Z" "a-z"
this is a test

However this works just fine and I get the output without using Ctrl-D..Why ?

cat - | tr "a-z" "A-Z" 

o/p

$ cat - | tr "a-z" "A-Z" 
this is a test
THIS IS A TEST

Original version of question:

cat "$@" | tr "a-z" "A-Z" | tr "A-Z" "a-z"

hangs when I run it on my bash shell prompt. Why is that?

My $@ is empty.

However this works like this

cat "$@" | tr "a-z" "A-Z" 
  • 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-21T10:02:40+00:00Added an answer on May 21, 2026 at 10:02 am

    What you’re seeing is due to buffering. In

    cat - | tr a-z A-Z | tr A-Z a-z
    

    (no quotes needed) you may not get the output immediately after you hit
    ENTER, because the middle or third tr may have buffered the data
    internally. At some point, they will flush their buffers and you’ll get
    the full, correct output. Hitting Ctrl-D closes the pipe and forces a flush.

    This is a fairly typical phenomenon when connecting several commands in one
    pipe.

    By the way, in this case (but not when using “$@”), the cat - is superfluous.

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

Sidebar

Related Questions

I've revised (but not changed) this question for brevity; see edits for previous version(s)
REVISED QUESTION : We have tracked this down to a custom add to cart
This is the revised version of my previous question Paralleling trading software The code
This is a revised/better written version of the question I asked earlier today --
EDIT AGAIN: NEW REVISED VERSION So I have corrected the lack of tag in
See Edit below initial question for a revised version of the original problem Using
Sometimes when switching branches using Git (version 1.7.2.1) it does not seem to remove
EDIT: my revised Entity relationship diagram A Student can have many contact times but
I followed RailsCasts authentication from scratch (http://railscasts.com/episodes/250-authentication-from-scratch-revised) using the bcrypt-ruby gem and have the
Edit: original question below, but I revise it now that I have some code

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.