Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to create a script to run simultaneously all the N64 Roms that I put inside a folder, reading the names from a text file.

Since now I did a script like this:

cat ./listN64_full.txt | while read line; do
    mupen64plus $line 
    echo "|"

The problem is that when the first emulated ROM is launched the script stops and I have to close the active window to run the second one.

How should I edit that script to load all them together?
The pipe seems doesn't work...


share|improve this question

Minimal modification to your script

cat ./listN64_full.txt | while read -r line; do
  mupen64plus "$line" & 
  sleep 1   # Better to give a second or 2 to create the window 
  echo "|"  # It's here because so it was... 

When you execute a script is like if you write it line by line.
It's more safe to use read -r line instead of read line.

To execute a command in background you have to put the & at the end of the command line.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.