Thanks for the reply Scott. I've got a function like this
function print_daemon_options {
echo "Start Daemons - Please enter one or a combination of the following:"
if isDatasubEnabled && isReconEnabled; then
echo "1 = CGT, 2 = Subscriber, 3 = Order Monitor, 4 = Revaluations, 5 = Reconciliation, 6 = All, 7 = Exit"
allowedInput = "1 2 3 4 5 6 7"
elif isDatasubEnabled && isReconEnabled=0; then
echo "1 = CGT, 2 = Subscriber, 3 = Order Monitor, 4 = Revaluations, 6 = All, 7 = Exit"
allowedInput = "1 2 3 4 6 7"
elif isDatasubEnabled=0 && isReconEnabled; then
echo "1 = CGT, 3 = Order Monitor, 4 = Revaluations, 5 = Reconciliation, 6 = All, 7 = Exit"
allowedInput = "1 3 4 5 6 7"
else
echo "1 = CGT, 3 = Order Monitor, 4 = Revaluations, 6 = All, 7 = Exit"
allowedInput = "1 3 4 6 7"
fi
echo allowedInput
}
function stop_daemons {
print_daemon_options
echo $allowedInput
}
stop_daemons calls the print one which should echo the options and also return the string but the error I get is:
Start Daemons - Please enter one or a combination of the following:
1 = CGT, 2 = Subscriber, 3 = Order Monitor, 4 = Revaluations, 5 = Reconciliation, 6 = All, 7 = Exit
print_daemon_options: ./wmfo_menu.sh[383]: allowedInput: not found
allowedInput
I made the change and I still get an error (and also, yep isDatasubEnabled and isReconEnabled are functions within the same script)
function print_daemon_options {
echo "Start Daemons - Please enter one or a combination of the following:"
if isDatasubEnabled && isReconEnabled; then
echo "1 = CGT, 2 = Subscriber, 3 = Order Monitor, 4 = Revaluations, 5 = Reconciliation, 6 = All, 7 = Exit"
allowedInput="1 2 3 4 5 6 7"
elif isDatasubEnabled && isReconEnabled=0; then
echo "1 = CGT, 2 = Subscriber, 3 = Order Monitor, 4 = Revaluations, 6 = All, 7 = Exit"
allowedInput="1 2 3 4 6 7"
elif isDatasubEnabled=0 && isReconEnabled; then
echo "1 = CGT, 3 = Order Monitor, 4 = Revaluations, 5 = Reconciliation, 6 = All, 7 = Exit"
allowedInput="1 3 4 5 6 7"
else
echo "1 = CGT, 3 = Order Monitor, 4 = Revaluations, 6 = All, 7 = Exit"
allowedInput="1 3 4 6 7"
fi
echo $allowedInput
}
function stop_daemons {
print_daemon_options
echo $(allowedInput)
}
Start Daemons - Please enter one or a combination of the following:
1 = CGT, 2 = Subscriber, 3 = Order Monitor, 4 = Revaluations, 5 = Reconciliation, 6 = All, 7 = Exit
1 2 3 4 5 6 7
stop_daemons: ./wmfo_menu.sh[383]: allowedInput: not found
function print_daemon_options {
echo "Start Daemons - Please enter one or a combination of the following:"
if isDatasubEnabled && isReconEnabled; then
echo "1 = CGT, 2 = Subscriber, 3 = Order Monitor, 4 = Revaluations, 5 = Reconciliation, 6 = All, 7 = Exit"
allowedInput="1 2 3 4 5 6 7"
elif isDatasubEnabled && isReconEnabled=0; then
echo "1 = CGT, 2 = Subscriber, 3 = Order Monitor, 4 = Revaluations, 6 = All, 7 = Exit"
allowedInput="1 2 3 4 6 7"
elif isDatasubEnabled=0 && isReconEnabled; then
echo "1 = CGT, 3 = Order Monitor, 4 = Revaluations, 5 = Reconciliation, 6 = All, 7 = Exit"
allowedInput="1 3 4 5 6 7"
else
echo "1 = CGT, 3 = Order Monitor, 4 = Revaluations, 6 = All, 7 = Exit"
allowedInput="1 3 4 6 7"
fi
echo $(allowedInput)
}
function stop_daemons {
print_daemon_options
echo $(allowedInput)
}
All I want it to do is print the options and then echo the allowedInput numbers
Start Daemons - Please enter one or a combination of the following:
1 = CGT, 2 = Subscriber, 3 = Order Monitor, 4 = Revaluations, 5 = Reconciliation, 6 = All, 7 = Exit
print_daemon_options: ./wmfo_menu.sh[398]: allowedInput: not found
stop_daemons: ./wmfo_menu.sh[398]: allowedInput: not found