Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 16. Process Management and Commu... > Replacing the Current Program with a...

Recipe 16.3. Replacing the Current Program with a Different One

16.3.1. Problem

You want to replace the running program with another, as when checking parameters and setting up the initial environment before running another program.

16.3.2. Solution

Use the built-in exec function. If exec is called with a single argument containing metacharacters, the shell will be used to run the program:


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial