First page Back Continue Last page Overview

 

Using functions, continued

 
  • Arguments may be passed to a shell function by using their own set of positional parameters ( $1, $2 etc. )

    • myFunction $filename
    • The value of $filename will be available as $1 inside the body of myFunction
  • Functions may return values by using the 'return' keyword which sets the value of the special variable $?