I have an expect script that is working if I pass it in a negative number. However, it will now not accept positive numbers. The values I am trying to pass are -12345 and 12345. Here is my script:
spawn -noecho $servicecode --enable
expect "Do you want to continue*" { send "y\n" }
expect "password:" { send "${password}\n" }
expect "passcode:" { send -- "${passcode}\n" }
expect "*Service has been successfully enabled*"
expect eof
EOF
Now, if I remove the "--" from the expect statement, it now accepts positive integers but will no longer accept negative integers. If I put back the "--", it accepts negative numbers but now not positive numbers.
Can anyone help me in figuring out how to send both positive and negative integers?