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

  • Home
  • SEARCH
  • 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 6800069
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:55:28+00:00 2026-05-26T18:55:28+00:00

Sorry if this seems like a dumb question but I am just learning bash

  • 0

Sorry if this seems like a dumb question but I am just learning bash scripting. For a school project we need to code an RTX that runs in Unix. It runs as a process in terminal and takes in user input and then prints it to the screen. I want to write a bash script to test that it can respond to lots of quick user input without overflowing or failing.

My main problem is that once the RTX starts the bash script will stop on that line until the RTX terminates and only then print the loop to the terminal (instead of printing it to the RTX prompt as I intend it to).

I have tried running the RTX in the background but that didn’t work. I need to find a way to redirect input to the RTX while it is still running with a bash script. Google searches didn’t come up with examples that I understood/could adapt. Any help is appreciated.

#!/bin/bash
# declare STRING variable
STRING="RTX Worked =D"
#Start the rtx in a new process, stuck on this line until rtx terminates. 
./main
#Somehow redirect io to the rtx. 
    for i in `seq 1 100`;
    do
            echo $i 
    echo " \n"
    done    
echo $STRING
  • 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-26T18:55:28+00:00Added an answer on May 26, 2026 at 6:55 pm

    You can run co-processes in bash and then send commands to the co-process via a pipe.

    see the Bash Manual under the coproc subcommand

    Its been a while since I did it and I’ve lost my examples but something like

    coproc RTX ./main
    
    for i in 'seq 1 100`;
    do
         echo $i >&{RTX[1]}
    done
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sorry, this seems like such an obvious question, but I just can't find an
Ok sorry this might seem like a dumb question but I cannot figure this
Sorry if this sounds like a really stupid question, but I need to make
Sorry if this seems like a stupid question but im actually having a hard
Sorry if this seems like a stupid question but can't find any info on
Sorry if this seems like an easy question, but I've started pulling hair out
Sorry if this question seems trivial to many here. In a C++ code there
Sorry if my question seems dumb. I've started using Eclipse Ganymede 3.4 this week
Sorry if this question seems obvious for everyone, but I am very new to
Sorry it seems like a repeated question, BUT I think I don't qualify to

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.