Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
424 views

7 Red Hat Enterprise Linux Shell Scripting Fundamentals m7 Slides PDF

This document discusses menus, functions, and scheduling in Bash scripting. It shows how to create menus using select and define reusable functions to process file values. Functions can be called multiple times to reduce redundant code. The document also demonstrates scheduling scripts to run periodically using cron jobs.

Uploaded by

eladzmr
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
424 views

7 Red Hat Enterprise Linux Shell Scripting Fundamentals m7 Slides PDF

This document discusses menus, functions, and scheduling in Bash scripting. It shows how to create menus using select and define reusable functions to process file values. Functions can be called multiple times to reduce redundant code. The document also demonstrates scheduling scripts to run periodically using cron jobs.

Uploaded by

eladzmr
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Menus, Functions, and Scheduling

Nigel Poulton
http://nigelpoulton.com
@nigelpoulton
Module Outline
Simple Menus Functions Scheduling
Creating Menus with
select
Functions
#!/bin/bash
# Not real code. Just for Pluralsight slide to show usefulness of Bash functions
<code>
<code>
<code>
<code>
<lots>
<of>
<code>
<to>
<process>
<values>
<in file>
<loop>
<code>
<code>
<lots>
<of>
<code>
<to>
<process>
<values>
<in file>
<done>
<code>
<code>
<code>
<lots>
<of>
<code>
<to>
<process>
<values>
<in file>
<code>
<code>
<if conditional>
#!/bin/bash
# Not real code. Just for Pluralsight slide to show usefulness of Bash functions
# Function to process values from files
process_files()
{
<code to process values from a file>
}
<code>
<code>
<code>
<code>
process_files #Call to function process_files()
<loop>
<code>
<code>
process_files #Call to function process_files()
<code>
<done>
<code>
<code>
<code>
process_files #Call to function process_files()
<code>
<code>
<if conditional>
<code>
process_files #Call to function process_files()
<fi>
<code>
process_files #Call to function process_files()
<code>
<code>
<code>
<while>
process_files #Call to function process_files()
<done>
<code>
Scheduling a Script
What We Covered
Menus (select) Functions
Scheduling
# Comments
read p Enter input: value
while [ $var le 0 ] ; do
done
Scripting Toolbox

You might also like