Forum Discussion
Jeremy_Bridges_
Nimbostratus
Aug 21, 2009Custom TCP Monitor
I am looking to do some custom TCP monitoring with a custom application that we need to monitor with the F5. Essentially, the application's thread handling logic will hang unless a specific set of se...
hoolio
Cirrostratus
Sep 03, 2009The echo command should be working okay. You won't see a null character echoed to standard out, as it's not a printable character. But xxd shows the null character as 00 in hex. od shows it as the escape sequence \0. You'll also probably want to suppress the trailing newline character echo adds by default by adding \c to the end of the echo string. See below for some examples.
If you view the monitor script with a hex editor like xxd or od, are the ^@ chars actually 00 (null in hex)? Or are they literally ^ and @? Can you upload the file?
You might try converting the entire send string into either octal \000 or hex \x00 to avoid any encoding issues.
Example using hex format of \x00
echo -e "0123\x00456"| xxd
0000000: 3031 3233 0034 3536 0a 0123.456.
Example using octal format of \0000
$ echo -e "0123\0000456"| xxd
0000000: 3031 3233 0034 3536 0a 0123.456.
od (utility to dump files in octal and other formats) shows the escape sequences for the unprintable character(s):
Example using hex format of \x00
$ echo -e "0123\x00456"| od -t c
0000000 0 1 2 3 \0 4 5 6 \n
0000011
Example using octal format of \0000
$ echo -e "0123\0000456"| od -t c
0000000 0 1 2 3 \0 4 5 6 \n
0000011
You can prevent echo -e from appending a newline character to the end of the string using \c:
$ echo -e "0123\x00456\c"| od -t c
0000000 0 1 2 3 \0 4 5 6
0000010
Aaron
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects
