12-15-2005 07:58 AM
I have a css11503 running 7.30.0.05 and I am trying to install a custom script (http://www.cisco.com/en/US/products/hw/contnetw/ps789/products_tech_note09186a00801e1dfb.shtml)
I login to the CSS, execute: script record http-test <enter>
However, when I paste in the script and it gets to the initial arg length checking:
"if ${$ARGS}[#] "NEQ" "3"
It errors out and says
%% Error undefined variable.
Any idea what I am doing wrong?
Thanks!
-wP
12-16-2005 12:03 AM
You have one $ sign in excess.
The correct line should be
if ${ARGS}[#]
Regards,
Gilles.
Thanks for rating this answer.
12-16-2005 08:32 AM
I mistyped in my original post -- i entered:
if ${ARGS}[#]
and I get
%% Error undefined variable
Thanks,
-wP!
12-17-2005 09:17 AM
try to load the script file via ftp instead of entering it line by line.
Gilles.
03-10-2015 07:53 AM
I have the same problem. It prompts an error in some lines though the "show script" seems to be ok. I'm worry about that the script won't work in production and I can test it.
I downloaded other similar scripts via FTP but FTP fails for this one, the CSS is no able to download the script from the FTP server.
Also I have downloaded via FTP similar scripts that starts with the same line (if ${ARGS}[#] "NEQ" "2".
My version is sg0820501. I know that the scripts configuration is ok cause I have it configured in other CSS.
CSS-Device# script record ap-kal-tcp-connect-graceful
Press Ctrl^C to terminate recording...
CSS-Device#
CSS-Device# if ${ARGS}[#] "NEQ" "2"
^
%% Error undefined variable.
CSS-Device# echo "Usage: xxx ip port"
Usage: xxx ip port
CSS-Device# exit script 1
CSS-Device# endbranch
endbranch: Not in Branch command.
CSS-Device#
CSS-Device# set HostNameA "${ARGS}[1]"
^
%% Error undefined variable.
CSS-Device# set PortA "${ARGS}[2]"
^
%% Error undefined variable.
CSS-Device#
CSS-Device#
CSS-Device# set EXIT_MSG "ERROR: Failed to connect"
CSS-Device# socket connect host ${HostNameA} port ${PortA} tcp 2000
^
%% Error undefined variable.
CSS-Device#
CSS-Device# no set EXIT_MSG
CSS-Device# socket disconnect ${SOCKET} graceful
^
%% Error undefined variable.
CSS-Device#
CSS-Device# exit script 0
CSS-Device#
CSS-Device#
Script <ap-kal-tcp-connect-graceful> recorded.
CSS-Device# show script ap-kal-tcp-connect-graceful
if ${ARGS}[#] "NEQ" "2"
echo "Usage: xxx ip port"
exit script 1
endbranch
set HostNameA "${ARGS}[1]"
set PortA "${ARGS}[2]"
set EXIT_MSG "ERROR: Failed to connect"
socket connect host ${HostNameA} port ${PortA} tcp 2000
no set EXIT_MSG
socket disconnect ${SOCKET} graceful
exit script 0
CSS-Device#
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide