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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:24:45+00:00 2026-05-27T06:24:45+00:00

I have the following command: ruby SaveAllDatabases.rb 192.168.0.15 1024 -r #0-D –non-interactive It’s a

  • 0

I have the following command:

ruby SaveAllDatabases.rb 192.168.0.15 1024 -r #0-D --non-interactive

It’s a fairly basic command in which I run a ruby script with some command line arguments. The -r argument is a regular expression (#0-D).

If I run this command on Windows (using the standard Windows command prompt), everything runs as expected, but if I try and run the same command on Linux (with the same version of ruby installed). I get the following error:

/usr/lib/ruby/1.8/optparse.rb:451:in `parse': missing argument: -r (OptionParser::MissingArgument)
  from /usr/lib/ruby/1.8/optparse.rb:1295:in `parse_in_order'
  from /usr/lib/ruby/1.8/optparse.rb:1254:in `catch'
  from /usr/lib/ruby/1.8/optparse.rb:1254:in `parse_in_order'
  from /usr/lib/ruby/1.8/optparse.rb:1248:in `order!'
  from /usr/lib/ruby/1.8/optparse.rb:1339:in `permute!'
  from /usr/lib/ruby/1.8/optparse.rb:1360:in `parse!'
  from SaveAllDatabases.rb:256

If I take the hash/pound (#) symbol out of the regex, the command runs fine. I’ve done a test, and the command line doesn’t seem pass anything after the # into the argv array.

Why is this, and how can I work round it?

  • 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-27T06:24:46+00:00Added an answer on May 27, 2026 at 6:24 am

    Take a look at the highlighting on your posted code. Notice how the # and everything after it are in gray? This is how you do comments in bash. Everything after the # is considered a comment.

    echo "This will show on the screen" # This is a comment, it's ignored 
    

    The solution is to quote the comment:

    ruby SaveAllDatabases.rb 192.168.0.15 1024 -r '#0-D' --non-interactive
    

    EDIT: Here’s a link with more information.

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

Sidebar

Related Questions

I have the following command which will loop over all the subdirectories in a
I have the following command which deletes files that are one day old and
I have the following Ruby script that creates a Debian package, which works fine:
I have found the following command in AWK useful in Vim :'<,'>!awk '{ print
I have a MySQL innodb database at 1.9GB, showed by following command. SELECT table_schema
I have the following function that deletes the LaTeX command surrounding the current cursor
I have created a certificate using the following SSL command: makecert -r -pe -n
My question is related to the command pattern, where we have the following abstraction
I have the following 2 regular expressions in a ruby file. They run fine
I have the following project structure which I can't get to work: Mac OS

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.