I want to add "debug" optio to my script, for that I added a read commands in specific places in the code. Basically it look like this:
#define it
READ_USER_INPUT_IF_IN_DEBUG_MODE="read -p 'press any key to continue:'"
#calling it
${READ_USER_INPUT_IF_IN_DEBUG_MODE}
the screen output is not as desired;
sm2edolt01.corp.nyx.com:/home/oracle/nir >./a.sh
'press
Tried to replace the '
with \"
as well.
"${READ_USER_INPUT_IF_IN_DEBUG_MODE[@]}"
will not return error in case of empty variable. Setting it to empty string resulting incommand not found
– Nir Nov 18 '18 at 16:16READ_USER_INPUT_IF_IN_DEBUG_MODE=()
instaed of the empty string – Simon Sudler Nov 19 '18 at 08:11