cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
533
Views
0
Helpful
4
Replies

How to put quote character into string on CSS11500?

jirka.novak
Level 1
Level 1

I'm trying to write kal script. Our service returns response in this form:

status="0" version 1.0

or

status="1" version 1.0

I'm able to connect to, but I need to write

somethink like

socket waitfor ${SOCKET} "status="1""

But it causes syntax error. I tried \"1\", \'1\', ""1"", but nothing works.

Does anyone have idea how to write this?

1 Accepted Solution

Accepted Solutions

you could also provide hexadecimal value instead of text using the option 'raw' at the end of the socket command.

http://www.cisco.com/en/US/products/hw/contnetw/ps792/products_administration_guide_chapter09186a00801eea3e.html#1004389

Regards,

Gilles.

View solution in original post

4 Replies 4

seilsz
Level 4
Level 4

Try:

socket waitfor $(SOCKET) "status=\'1\'"

or

socket waitfor $(SOCKET) "status='1'"

~Zach

you could also provide hexadecimal value instead of text using the option 'raw' at the end of the socket command.

http://www.cisco.com/en/US/products/hw/contnetw/ps792/products_administration_guide_chapter09186a00801eea3e.html#1004389

Regards,

Gilles.

It works, thank you.

Note:

hexa codes have to be without 0x, so for

word 'status' I have to wait for:

! s t a t u s

socket waitfor ${SOCKET} "737461747573" raw

It doesn't work. I think, that \' sequence is interpreted as " only by echo command. If you try

set EXIT_MSG "Test \'"

and script ends with error, you will see

Test \'

But if you do the same with echo, you will se

Test "

Review Cisco Networking for a $25 gift card