0
I have created a script that is supposed to (in the below section) store the name and location of their corresponding values in an assigned variable, then list the name variables in a column. I have successfully done this before, but for some reason all I am getting are empty lines. Please help me because I can't seem to make heads or tails of this problem.
#This is where sections are added or removed
#SECTIONnumberNAME=$(echo "number: section name")
#SECTIONnumberLOCARION=./Setup_Fedora_Sections/section_name.sh
SECTION1NAME=$(echo "1: Wireless Card")
SECTION1LOCARION=./Setup_Fedora_Sections/Setup_Fedora_Wireless_Card.sh
SECTION2NAME=$(echo "2: Basic Setup")
SECTION2LOCARION=./Setup_Fedora_Sections/Setup_Fedora_Basic_Setup.sh
SECTION3NAME=$(echo "3: Optional Programs")
SECTION3LOCARION=./Setup_Fedora_Sections/Setup_Fedora_Optional_Programs.sh
#This is where selection offers are added or removed
#echo $'\n'$SELECTIONnumberNAME
echo $'\n'$SELECTION1NAME
echo $'\n'$SELECTION2NAME
echo $'\n'$SELECTION3NAME
Why would you ever use
variable=$(echo text)
instead ofvariable=text
? – AFH – 2016-06-28T21:56:54.860Often it is cosy to copy and past always (or never) the variable name to avoid to make errors... You are printing empty variables (
$SE
LECTIONxNAME
and not$SECTIONxNAME
). Moreover to debug a script you can writeset -
(andset +
) at the beginning (and the end) of the part to debug. – Hastur – 2016-06-28T22:01:42.990