NET 4000 Chapter Notes - Chapter 10.2.10: Shell Script, Opensuse

33 views1 pages
9 Dec 2017
School
Department
Course
Professor

Document Summary

The bash shell allows custom functions to be defined. A function contains a list of commands to run. When a function is defined, it can be called from the shell prompt (or from within a script) and used as if it were a standard internal or external command. However, a function added at the shell prompt is not saved in a file by default; it only exists in memory and will be lost when the current shell session is closed. To make the function persistent, it must be defined in a bash configuration file or saved in a script file. The syntax for defining a function from the shell prompt is: function_name () command1 command2 command3. For example, the following function looks for files in a specified directory that have the suid or sgid permission set: auditfiles () find -type f -perm -u=s -ls find -type f -perm -g=s -ls.

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

Related Questions