Anyone able to assist with the following:
#!/bin/ksh
-- snip --
echo "\n\nEnter number associated with the change: \c"
read inc_num
if [[ "$inc_num" = ? ([+-]) + ([0-9]) ]] || [[ $inc_num = S ]] || [[ $inc_num = s ]]
then
-- snip --
Above code used to ensure that only a numerical value (or an S) is entered for inc_num, but unfortunately it's bombing out at the following:
/rsl_v2: line 35: syntax error in conditional expression: unexpected token `('
./rsl_v2: line 35: syntax error near `(['
./rsl_v2: line 35: ` if [[ "$inc_num" = ? ([+-]) + ([0-9]) ]] || [[ $inc_num = S ]] || [[ $inc_num = s ]]'
Not sure whether it's a genuine syntax error, cause I've tested this on another system and it works fine - could it be the version of ksh maybe?
Thanks in advance.
CiCa