How to do it...

Now we will write a simple shell script that will print “Hello World”. Using SHC, the Shell script will be converted into binaries directly. Create a script hello.sh, and write the following content in it.

#!/bin/bashecho "Hello World"a=10b=20c=$((a+b))echo $c

Now, to log all commands, run the logger command as follows:

$ logger -f hello.sh

Get Bash Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.