Telnet character conversion - Linux

This is a discussion on Telnet character conversion - Linux ; -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I'm having a problem with scripting telnet on a RH ES machine. Essentially, I am echoing a value into telnet and some sort of character conversion is taking place that causes garbage to be ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Telnet character conversion

  1. Telnet character conversion

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    I'm having a problem with scripting telnet on a RH ES machine.
    Essentially, I am echoing a value into telnet and some sort of
    character conversion is taking place that causes garbage to be sent.

    EX:
    echo $the_hostname | telnet my.machine 6789

    I'm experiencing a problem such that if $the_hostname contains the
    number 7, my.machine gets the data up to the number 7 and then some
    garbage.

    "strace" output from telnet during this operation:
    Code:
    read(0, "gap07\n", 8192) = 6
    [...]
    send(3, "gap0\377\364\377\375\6", 9, 0) = 9

    This only happens on a certain group of hosts, and then only when using
    the script -- manually performing the telnet and entering $my_hostname
    works. What might cause this? I haven't been able to determine any
    difference between the hosts that work and the hosts that dont.

    Netcat does not experience the problem.

    Linux xxxxx 2.4.9-e.24smp #1 SMP Tue May 27 16:07:39 EDT 2003 i686
    unknown
    Red Hat Enterprise Linux ES release 2.1 (Panama)

    Thanks,
    - -Jason Martin
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.2.6 (GNU/Linux)

    iD8DBQFCHgHtl2ODWuqVSBMRAp/fAJ9DPi1EPGL5toKrE8A+liEyF1GGewCfQ6BQ
    yIvWOfvtbCGl5j8Jdh8HsRA=
    =yAj+
    -----END PGP SIGNATURE-----


  2. Re: Telnet character conversion

    On Thu, 24 Feb 2005 08:35:38 -0800, Jason Martin thoughtfully wrote:

    > -----BEGIN PGP SIGNED MESSAGE-----
    > Hash: SHA1
    >
    > I'm having a problem with scripting telnet on a RH ES machine.
    > Essentially, I am echoing a value into telnet and some sort of character
    > conversion is taking place that causes garbage to be sent.
    >
    > EX:
    > echo $the_hostname | telnet my.machine 6789
    >
    > I'm experiencing a problem such that if $the_hostname contains the number
    > 7, my.machine gets the data up to the number 7 and then some garbage.
    >
    > "strace" output from telnet during this operation: Code:
    > read(0, "gap07\n", 8192) = 6 [...]
    > send(3, "gap0\377\364\377\375\6", 9, 0) = 9
    >
    > This only happens on a certain group of hosts, and then only when using
    > the script -- manually performing the telnet and entering $my_hostname
    > works. What might cause this? I haven't been able to determine any
    > difference between the hosts that work and the hosts that dont.
    >
    > Netcat does not experience the problem.
    >
    > Linux xxxxx 2.4.9-e.24smp #1 SMP Tue May 27 16:07:39 EDT 2003 i686 unknown
    > Red Hat Enterprise Linux ES release 2.1 (Panama)
    >


    Could it be that $the_hostname" is being interpreted as hex on the
    non-working hosts?

  3. Re: Telnet character conversion

    noi wrote:
    > > echo $the_hostname | telnet my.machine 6789

    > Could it be that $the_hostname" is being interpreted as hex on the
    > non-working hosts?


    Doubt it. The shell should expand the variable before executing the
    line.


  4. Re: Telnet character conversion

    On Sat, 26 Feb 2005 05:37:44 -0800, robertharvey thoughtfully wrote:

    > noi wrote:
    >> > echo $the_hostname | telnet my.machine 6789

    >> Could it be that $the_hostname" is being interpreted as hex on the
    >> non-working hosts?

    >
    > Doubt it. The shell should expand the variable before executing the line.


    When using (date +%d) the script failed because "08" is interpreted as
    hex not decimal 01-07,10-31 worked fine.

+ Reply to Thread