When executing a shell script in the bash shell on USS, we found that the input from a read statement in the script returns nothing, even if the user has input some text.
echo -n "Please provide the application mnemonic and press [ENTER]: "
appMnemonic=$(echo “$appMnemonic” | tr ‘[:upper:]’ ‘[:lower:]’)
The appMnemonic variable in this script is just empty when the echo prints even if the user has typed in an alphanumeric value. We noticed that this was happening when the script is executed from the bash shell, works fine in standard shell. Because of this on of our directories was entirely clobbered.
bash-4.3$ bash -version
GNU bash, version 4.3.46(51)-release (i370-ibm-openedition)
Copyright © 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html