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 1069991
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T20:30:01+00:00 2026-05-16T20:30:01+00:00

It works great when I use expect interactively like this: root@vagrantup:/home/vagrant> expect -i expect1.1>

  • 0

It works great when I use expect interactively like this:

root@vagrantup:/home/vagrant> expect -i
expect1.1> spawn screen -x
spawn screen -x
3195
expect1.2> send "ls\n"
expect1.3> exit

But the same commands used in a file:

spawn screen -x
send "ls\n"
exit

Only works sometimes, eg. 1/10 time every time I execute the file. It’s really weird.

I execute the file with this command:

expect -f Expectfile

I have also tested these:

expect -b Expectfile
expect Expectfile

But I get the same error.

It doesn’t say anything. The other screen (since I’m using “screen” command) only responds sometime. Anyone knows why?

  • 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-05-16T20:30:01+00:00Added an answer on May 16, 2026 at 8:30 pm

    I hope you’re using ls to stand in for something else, because if you just want a local listing of files, you’re far better off using the glob command. Of course, you might actually be doing something like that, what with the use of screen -x too, but it smacks to me of being a little over-complex right now.

    Possible failures (though I’m shooting in the dark here due to lack of evidence) could be an interaction between the various things using virtual terminals (both expect and screen do that, and there’s just not that many virtual terminals available system-wide) or some kind of timing problem due to not enough time for a connection to a session to be reestablished. (Failing 9 times out of 10 though? That’s a lot.) If it is the timing problem, inserting an after 500 will help. If it is the count of terminals, you’ve got problems; maybe it would be possible to spot this with a tool like lsof but there’s a lot of moving parts and I don’t know what’s failing.

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

Sidebar

Related Questions

I use the line below in my C# winform app, this works great but
I use this script to show an additional language menu additional, which works great
I use the wonderful jQuery-plugin Galleriffic to display image galeries. Now this works great,
i am trying to use this code: <%= File.ReadAllText(Server.MapPath(Members/newsletters/welcome.html))%> which works great but now
I use Tank Auth library on my site and it works great from frontend.
I use edit-in-place plugin: http://arashkarimzadeh.com/jquery/7-editable-jquery-plugin.html I't works Great! I just need something to check
I use VS 2010 to debug a single IronPython module. Everything works great. I
I'm trying to use the i18n feature of simple form, which works great in
This works great: <style type=text/css> div { width:100px; height:100px; background:red; transition:width 2s; -moz-transition:width 2s;
This works great: $(document).ready(function() { var previewwidth = ($(window).width() - ( $('.aside').width() + $('.results').width()

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.