Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9016499
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:00:45+00:00 2026-06-16T04:00:45+00:00

I want to connect to a remote host using telnet there is no username/password

  • 0

I want to connect to a remote host using telnet
there is no username/password verification
just

telnet remotehost

then I need to input some commands for initialization

and then I need to repeat the following commands:

cmd argument

argument is read from a local file, in this file there are many lines, each line is a argument
and after runing one “cmd argument”, the remote host will output some results
it may output a line with string “OK”
or output many lines, one of which is with string “ERROR”
and I need to do something according to the results.

basically, the script is like:

initialization_cmd  #some initial comands
while read line
do    
  cmd $line
  #here the remote host will output results, how can I put the results into a variable?
  # here I want to judge the results, like
  if $results contain "OK";then
       echo $line >>good_result_log
  else
       echo $line >> bad_result_log
  fi     
done < local_file

 the good_result_log and bad_result_log are local files

is it possible or not? thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T04:00:46+00:00Added an answer on June 16, 2026 at 4:00 am

    This won’t work as echo will output to the stdout of the tty and not to the stdin of the telnet process.

    I would suggest writing an expect script for this task. Perhaps you could adapt something like this.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using Hyper-V Manager, I can connect to a remote VM host, go to the
I am trying to connect to a remote server through ssh. $ssh username@host command
I am using the following code in Titanium Appcelerator to connect with remote Host:
I want to connect to a remote host listed in ~/.ssh/config , run a
There I am trying to load XML content from a remote host using Node.js.
I want to connect to a remote database (SQL Server 2008) through code using
Is there a way to connect to a remote sql server using management studio
I want to connect from home using SQL Server 2005 to another PC. I
I just installed VS2010 and I want to connect to TFS, But I don't
I am developing an application which, on providing the host, username, password and table

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.