Launch and run commands from shell script

December 2016


I have a requirement to launch a busybox (Qemu) shell and needs to pass the commands to get the result. How I can achieve this.

For example:

I have the running Qemu and I am telnetting to get shell.

Open the terminal and do a
this command will takes to a busybox shell now type "ps" command this will gives all the running process inside the Qemu.

Now i want to automate the above steps in a shell scripting something like
#! /bin/sh 



The code below works for me:

#! /bin/bash 

sleep 1 
) | telnet 



Thanks to Hari for this tip on the forum.

Related :

This document entitled « Launch and run commands from shell script » from CCM ( is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the license, as this note appears clearly.