Software Development Degree BTB520 Lecture Notes - Lecture 12: Teleprinter, Terminal Capabilities, Computer Terminal

51 views4 pages

Document Summary

Lecture 12 - advanced scripting - trap; functions; Terminal handling trap trap specifies action to take when a signal is detected trap "rm -f /tmp/*32417*; exit" int - action for -c trap - int. Functions function definition: function_name() { statements invoked by using name, can pass arguments. Must be defined before use, usually at the beginning of the script. Arguments replace the , , variables during function execution. return statement can be used to return a numeric value, same as exit from a script to return strings, either place in a variable, or use command substitution when invoking the function. An example, the function placing the result into a variable; notice that all variables are global: ==> cat functions. example1 add() { sum=0 for num do sum=0 done add 23 45 -17 echo . A similar example, using the return statement:

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents