CSC231 Bash Tutorial 8
--D. Thiebaut (talk) 13:13, 1 November 2017 (EDT)
Bash Functions
There are two ways of declaring functions in bash, illustrated in the code below:
#! /bin/bash # func1.sh # D. Thiebaut # prints some messages printSomething() { echo "Hello there!" } function printSomethingElse { echo "Hello again!" } printSomething printSomething printSomethingElse