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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:11:43+00:00 2026-05-26T12:11:43+00:00

Currently I am working with a embedded system that has the Linux OS. I

  • 0

Currently I am working with a embedded system that has the Linux OS. I need to run multiple application at the same time, and I would like them to be able to run through one script. A fellow colleague already had implemented this by using a wrapper script and return codes.

wrapperScript.sh $command & > output_log.txt
wrapperScript.sh $command2 & >output_log2.txt

But the problem arises in when exiting the application. Normally all the application that are on the embedded system require a user to press q to exit. But the wrapper script rather than doing that when it gets the kill signal or user signal, it just kill the process. This is dangerous because the wrapper script assumes that the application has the proper facilities to deal with the kill signal (that is not always the case and leads to memory leaks and unwanted socket connections). I have looked into automating programs such as expect but since I am using an embedded board, I am unable to get expect for it. Is there a way in the bash shell or embedded C to deal with multiple process have one single program automatically send the q signal to the programs.

I also would like the capability to maintain log and the output of the files.

EDIT:

Solution:

Okay I found the issue to the problem, Expect is the way to go about it in any situation. There is a serious limitation that it might slower, but the trade off is not bad in this situation. I decided to use Expect Scripting Language to implement the solution. There are certain trade off.

Pros:
* Precise control over embedded application
* Can Make Process Interactive to User
* can Deal with Multiple Process

Cons:
* Performance is slow

  • 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-26T12:11:43+00:00Added an answer on May 26, 2026 at 12:11 pm

    Use a pipe

    Make the command read input from a named pipe. You’ll then be able to send it commands from anywhere.

    mkfifo command1.ctrl
    { "$command1" <command1.ctrl >command1.log 2>&1;
      rm command1.ctrl; } &
    

    Use screen

    Run your applications inside the Screen program. You can run all your commands in separate windows in a single instance of screen (you’ll save a little memory that way). You can specify the commands to run from a Screen configuration file:

    sessionname mycommands
    screen -t command1 command1
    screen -t command2 command2
    

    To terminate a program, use

    screen -S mycommands -p 1 -X stuff 'q
    '
    

    where 1 is the number of the window to send the input to (each screen clause in the configuration file starts a window). The text after stuff is input to send to the program; note the presence of a newline after the q (some applications may require a carriage return instead; you can get one with stuff "q$(printf \\015)" if your shell isn’t too featured-starved). If your command expects a q with no newline at all, just stuff q.

    For logging, you can use Screen’s logging feature, or redirect the output to a file as before.

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

Sidebar

Related Questions

I'm working on an embedded project that currently uses C in Linux and uClibc.
I'm working with an embedded system running QNX that has a stripped-down shell (KSH).
I'm currently working on an embedded system that needs to read keyboard input (Actually
Am currently working on an application that requires users to submit posts and comments
I'm working on an embedded Linux project. Our build process makes an image that
I'm working on swing application that relies on an embedded H2 database. Because I
I am currently working on a code base, that has never had any unit
in an application I'm working on, I need to interact with iPhone's AddressBook. Currently,
I currently working with embedded linux with bash shell on it. Write now I
I'm currently working on an audio recording application, that fetches up to 8 audio

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.