Creating Fun Little Shell Scripts
Richard A. Blum, Christine Bresnahan · 2015
This chapter shows how to put some of the shell-scripting information to use for fun little bash shell scripts. It demonstrates how to send a message to another user on the Linux system. The script can be used to check whether the user is logged on to the system and whether the user is allowed to send a message. After those checks are made, the passed message is sent using the write command. Included are some suggestions for modifying this script, which improve our shell-scripting abilities. The chapter then walks us through obtaining website information using the wget utility. The script uses several utilities to pull out the actual quote text. Familiar commands include sed, grep, gawk, and the tee command. The chapter ends with a very fun and simple script for sending ourselves a text message, exploring the curl utility, along with SMS concepts.