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

  • Home
  • SEARCH
  • 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 6069373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:48:57+00:00 2026-05-23T09:48:57+00:00

everyone. I’m a bash script noob, and I’m failing to figure out why I’m

  • 0

everyone.

I’m a bash script noob, and I’m failing to figure out why I’m getting an unexpected end of file error.

This is my script:

#!/bin/bash

server=8100

while [ $server -le 8121 ]
do
        ssh pos$server <<ENDEXP
        mysql -u root -p12345 pos_master_prod <<ENDEXP
        show slave status \G <<ENDEXP
        \q <<ENDEXP
        server=$(( $server + 1 ))
done

Any ideas?

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-05-23T09:48:57+00:00Added an answer on May 23, 2026 at 9:48 am

    If I understand what it’s supposed to do, this should work:

    #!/bin/bash
    
    for ((server=8100; server <= 8121; server++)); do
        ssh pos$server <<-ENDEXP
            mysql -u root -p12345 pos_master_prod
            show slave status \G
            \q
        ENDEXP
    done
    

    (Note: be sure the lines to be sent to the remote server are indented with tabs, not spaces; <<- removes leading tabs, but not other forms of indentation.)

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

Sidebar

Related Questions

everyone! new to here and been pondering about this myself for some times with
everyone! I try to update values in .resx file with ResXResourceWriter and the value
everyone. I have some labels that I draw them in the xib file, and
everyone. I know this is a far treated subject, but I've looked everywhere and
everyone! I want to know what this line does: sqlplus -s /nolog <<EOF Any
everyone. I'm new here and this is my first post. I'm creating a simple
everyone, I have this piece of the code: void foo(int var, int var1) {
everyone! I've been at this for a while, and I'm not sure how this
everyone.. I'm not a complete noob to linux, I'm using Fedora 16, but I've
everyone. Can someone share some links on articles about back end caching and fragment

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.