#!/bin/bash # combineWords.bash # Author: Murray Saul # Date: January 30, 2009 # # Purpose: To demonstrate the use of parameter expansion # to be used to combine both text and variable values... read -p "Enter a word: " wordName echo echo "Let's show you some commands using both the word \"ish\"" echo "and your word \"$wordName\" that is stored in the variable" echo "called \"wordName\"..." echo echo "Here is a command NOT using parameter expansion:" echo "echo \"Combined word: \$wordNameish.\"" echo "Combined word: $wordNameard." echo echo "Here is a command USING parameter expansion (notice the braces):" echo "echo \"Combined word: \${wordName}ish.\"" echo "Combined word: ${wordName}ish." echo echo "Which one works better?"