December 2018
Beginner
452 pages
12h 17m
English
Some functions follow the processor archetype: they take input, do something with it, and return the result back to the caller. This is something of a classic function: depending on the input, different output is generated. We'll show this with an example that reverses the input the user specifies to the script. This is normally done with the rev command (and will actually be accomplished with rev in our function as well), but we're creating a wrapper function around this with a little extra functionality:
reader@ubuntu:~/scripts/chapter_13$ vim reverser.sh reader@ubuntu:~/scripts/chapter_13$ cat reverser.sh #!/bin/bash###################################### Author: Sebastiaan Tammer# Version: v1.0.0# Date: 2018-11-17# Description: ...