[NTLUG:Discuss] bash Script help

Patrick R. Michaud pmichaud at pobox.com
Wed Aug 28 16:37:17 CDT 2013


On Wed, Aug 28, 2013 at 04:26:32PM -0500, Bobby Wrenn wrote:
> >./FactoryRestore.sh&
> 
> I realized that when I execute the final script by itself that I
> have to sudo because of partimage. I think that may be it.

Because of the &, you may need to wait a couple of seconds
before letting the script exit, otherwise the parent process
may signal the child process to exit as well.

But even better might be to not use an & at all, and simply do

    exec ./FactoryRestore.sh

This replaces the current shell with ./FactoryRestore.sh
without creating a new process.

Pm



More information about the Discuss mailing list