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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T23:21:04+00:00 2026-06-14T23:21:04+00:00

I am trying a program (prog1) which generates binary output (it is a encoder)

  • 0

I am trying a program (prog1) which generates binary output (it is a encoder) that I want to pass to another program (prog2) . prog2 can take data from stdin, so I would like to pipe the output of prog1 to prog2. The problem is, since it is binary data, the terminal can get corrupted.
for example
$> prog1 | prog2 –

Is there any other way ? I would like to avoid writing glue code just to route the data between the two if I can.

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-14T23:21:05+00:00Added an answer on June 14, 2026 at 11:21 pm

    When you write

    $ prog1 | prog2 -
    

    everything that prog1 write to its stdout goes to prog2, not to your tty. It is certainly possible for prog1 to write data to the terminal, either by writing binary data to stderr, or by other means, but it is more likely that your prog2 is writing binary data as well. As a simple test, try:

    $ prog1 | prog2 - | xxd
    

    (If you don’t have xxd, try any hex dump program, or perhaps just od)

    If that doesn’t work, try:

    $ { prog1 | prog2 - | xxd; } 2> /dev/null
    

    or

    $ { prog1 | prog2 -; } 2>&1 | xxd
    

    or some other variation on that theme.

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

Sidebar

Related Questions

I am trying to program a noise reduction algorithm that works with a set
I'm trying to program an Android interface which uses an expandable list on the
<?php $output=shell_exec('gcc prog.c'); echo $output; ?> I'm trying execute a c program using php
I am using sbcl 1.0.57.0 and want to start a program via --eval which
I'm trying to create a program that will return a certain number decomposed to
I am trying to program a simple Android app that will stream an internet
I'm trying to program a PHP-script, where users can rate the goodness of the
i am trying to compile a fortran 90 program which has a call to
I'm trying to make a program that does this: Calls program 1 in a
I am trying to pass '-f nameoffile' to the program when I call it

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.