Run shell command from child shell

Posted by LinuxPenseur on Stack Overflow See other posts from Stack Overflow or by LinuxPenseur
Published on 2011-01-11T13:29:59Z Indexed on 2011/01/11 13:53 UTC
Read the original article Hit count: 330

Filed under:
|
|
|

Hi,

I have a Unix shell script test.sh. Within the script i would like to invoke another shell and then execute the rest of the commands in the shell script from the child shell and exit

To make it clear:

test.sh

#! /bin/bash

/bin/bash /* create child shell */

<shell-command1>
<shell-command2>
......

<shell-commandN>

exit 0

What my intention is to run the shell-commands1 to shell-commandN from the child shell. Kindly tell me how to do this

© Stack Overflow or respective owner

Related posts about shell

Related posts about unix