Find the answer to your Linux question:
Results 1 to 3 of 3
Is it possible to launch telnet and send command from file to it? Ex. I have file "commands" with IRC'a commands: Code: NICK tempNick USER tempNick 8 * : John ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Aug 2011
    Posts
    3

    Question How to redirect file content to telnet?


    Is it possible to launch telnet and send command from file to it?

    Ex. I have file "commands" with IRC'a commands:
    Code:
    NICK tempNick
    USER tempNick 8 *  : John Smith
    JOIN #someChannel
    QUIT
    Now i want to launch telnet and connect to IRC server:
    Code:
    telnet irc.freenode.org 6667 < ./commands

    but i get message:
    Code:
    ~$ telnet irc.freenode.org 6667 < ./commands
    Trying 140.211.167.98...
    Connected to chat.freenode.net.
    Escape character is '^]'.
    Connection closed by foreign host.
    What is wrong? And how to do it?

  2. #2
    Linux Engineer rcgreen's Avatar
    Join Date
    May 2006
    Location
    the hills
    Posts
    1,134

  3. #3
    Just Joined!
    Join Date
    Aug 2011
    Posts
    3
    yes, but i didnt tried it yet. I tried this:
    Code:
    (sleep 3; cat ./irc-send-bot-cmd-login; sleep 15; cat ./irc-send-bot-cmd; sleep 5) | nc server port
    and it works.

    Anyway thx all.

  4. $spacer_open
    $spacer_close

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •