02-12-2002
Well, I don't know of any way to do that in telnet, unless it's a mapped key combination you're sending (like control-M, control-s, etc...). You should be able to use netcat or something similar to provide a raw interface. Some shells, like bash and ksh, support the ability to send to a raw interface using the following format:
/dev/tcp/hostname/port
So you could send the string "hello" to port 55 of your local machine by doing this:
echo "hello" > /dev/tcp/localhost/55
To get hex, you can do something like run it through a hex dumper, like "xd" or "xxd"...
echo "Hello" | xxd -p | nc hostname port
Is that what you're looking for?
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I've written some basic programs in Perl, but unwaware abut socket programming in Perl.
I need to write a file called syslog, onto port 514 of another host from port 514 of my machine. Is this possible in Perl? Which modules are to be used?
Regards,
Rahul. (1 Reply)
Discussion started by: rahulrathod
1 Replies
2. Fedora
Greetings,
A sort of newbie question...
I would like to control a couple of stepper motors via the parallel port using C code. I have discovered in Linux, the ioperm() function is required before the outportb() function can be used to send a byte to the parallel port. My problem is ioperm()... (1 Reply)
Discussion started by: meyerga00
1 Replies
3. Programming
Hi All,
My main intension of is to convert the Hexstring stored in a char* into hex and then prefixing it with "0x" and suffix it with ','
This has to be done for all the hexstring char* is NULL.
Store the result prefixed with "0x" and suffixed with ',' in another char* and pass it to... (1 Reply)
Discussion started by: rvan
1 Replies
4. Programming
Hi,
Is there really a difference between these two, std::hex and ios::hex??
I stumbled upon reading a line, "std::ios::hex is a bitmask (8 on gcc) and works with setf(). std::hex is the operator". Is this true?
Thanks (0 Replies)
Discussion started by: royalibrahim
0 Replies
5. IP Networking
Hi ,
Currently DELL OMSA SNMP sends data through default udp port 161.I want my custom SNMP MIB also to send data in the same udp port 161.Whether its possible.If yes where to configure .I tried starting my custom MIB in udp port 161,but it throws port already in use.Kindly guide. (0 Replies)
Discussion started by: prabakar4all
0 Replies
6. Red Hat
Hi ,
Currently DELL OMSA SNMP sends data through default udp port 161.I want my custom SNMP MIB also to send data in the same udp port 161.Whether its possible.If yes where to configure .I tried starting my custom MIB in udp port 161,but it throws port already in use.Kindly guide. (1 Reply)
Discussion started by: prabakar4all
1 Replies
7. Solaris
Hi Everyone,
In my environment, I have few T5220. On the iLOM Management Card, I have both Network and Serial port are cabled, I don't have any issues while I try to connect using Network Management port, but when I try to connect the serial port for the same server which is actually connected... (3 Replies)
Discussion started by: bobby320
3 Replies
8. Shell Programming and Scripting
Assume I have a file \usr\home\\somedir\myfile123.txt
and I want to replace all occurencies of the two (concatenated) hex values x'AD' x'A0' bytwo other (concatenated) hex values x'20' x'6E'
How can I achieve this with the gnu sed tool?
Additional question: Is there a way to let sed show... (1 Reply)
Discussion started by: pstein
1 Replies
9. Solaris
please find the below o/p for your reference
bash-3.00# fcinfo hba-port
HBA Port WWN: 21000024ff295a34
OS Device Name: /dev/cfg/c2
Manufacturer: QLogic Corp.
Model: 375-3356-02
Firmware Version: 05.03.02
FCode/BIOS Version: BIOS: 2.02; fcode: 2.01;... (3 Replies)
Discussion started by: sb200
3 Replies
LEARN ABOUT DEBIAN
upscli_splitname
UPSCLI_SPLITNAME(3) NUT Manual UPSCLI_SPLITNAME(3)
NAME
upscli_splitname - split a UPS definition into its components
SYNOPSIS
#include <upsclient.h>
int upscli_splitname(const char *buf, char **upsname,
char **hostname, int *port)
DESCRIPTION
The upscli_splitname() function takes a pointer to the raw UPS definition buf and returns pointers to dynamically allocated memory in
upsname and hostname. It also copies the port number into port.
FORMATTING
A UPS definition is specified according to this format:
<upsname>[@<hostname>[:<port>]]
When the UPS name is not given, this function will print an error to stderr and return -1 without changing anything.
Definitions without an explicit port value receive the default value of 3493. The default hostname is "localhost".
MEMORY USAGE
You must free(3) the pointers to upsname and hostname when you are done with them to avoid memory leaks.
RETURN VALUE
The upscli_splitname() function returns 0 on success, or -1 if an error occurs.
SEE ALSO
upscli_fd(3), upscli_get(3), upscli_readline(3), upscli_sendline(3), upscli_splitaddr(3), upscli_ssl(3), upscli_strerror(3),
upscli_upserror(3)
Network UPS Tools 05/22/2012 UPSCLI_SPLITNAME(3)