How to Run Several Instance of a Execute Program On a Shell One at Time

I want to execute several instance of a executable program one at a time when I run it. For example I want to run several instances of a program with the name a when I get session and run
? A
At command line
And it runs 3 or 4 A

You should be aware that background processes (started using & or put into the background with the bg command) will be stopped if they read stdin from the terminal.

That's because you have to be able to type at the shell to enter new commands or control the existing jobs. If you have a foreground job, the shell waits for it (but can get a SIGINT etc from the X server). If you have no foreground job, the shell foregrounds itself. If you want to get the shell back from behind a foreground job, you Ctrl-Z the foreground, it gets a SIGSTOP, and the shell puts up a prompt for you.

I forget the mechanism by which the background job stops: something like:

[3] YourCommandLine: STOPPED (SIGTTY input request)

The [3] is the job number (different to process number) and you have to: fg %3
to get it into the foreground so it can read the /dev/tty. Or you can kill %s, bg %3 and so on.

Copyright 1998-2015 Ziff Davis, LLC (Toolbox.com). All rights reserved. All product names are trademarks of their respective companies. Toolbox.com is not
affiliated with or endorsed by any company listed at this site.