The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 08-22-2007
porter porter is offline
Registered User
 

Join Date: Jan 2007
Posts: 2,965
Quote:
Originally Posted by prez View Post
so why it is not run as a child process when function is called directly in the main script
1. because that is what shells do.

2. It's more useful as so you *can* have functions that change global variables.

3. It means it does not have to fork() another process to do the job.
Reply With Quote