Operating System - HP-UX
1830239 Members
1751 Online
109999 Solutions
New Discussion

Want to create a string with control characters

 
Smaran
Occasional Advisor

Want to create a string with control characters

Hi Everybody,
I want to create a string(message) which will have
control characters, including line feed (^J) also. And wants to write the message to the socket.
Can nyone help me in this regard ?

Thanks in advance

3 REPLIES 3
John Poff
Honored Contributor

Re: Want to create a string with control characters

Hi,

This sounds like a job for a Perl script.

JP
Smaran
Occasional Advisor

Re: Want to create a string with control characters

My purpose is to crete a mesge and write that mesage directly into the socket which will have
control char.
Can u explain how to do it ?
Bill Costigan
Honored Contributor

Re: Want to create a string with control characters

You can echo using octal numbers for the control characters,

'Hello There' would be

echo "Hello \0015\0012 There"