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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:23:18+00:00 2026-05-26T23:23:18+00:00

As is known, the Ruby’s Kernel#spawn method executes the specified command and returns its

  • 0

As is known, the Ruby’s Kernel#spawn method executes the specified command and returns its pid. The method can accept either a whole command line as a single argument, a command name and any number of the command’s arguments or an array where the first element is the command itself and the second is, according to the documentation, the strange variable argv[0]. As it turned out, the variable has nothing to do with the Ruby’s ARGV[0].

What is this variable? What does it contain?

Thanks.

Debian GNU/Linux 6.0.2;

Ruby 1.9.3-p0.

  • 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-26T23:23:19+00:00Added an answer on May 26, 2026 at 11:23 pm

    I don’t think it’s a variable at all.

    When executing a command (in the general case), the arguments go into argv[1] to argv[*n*]. The name of the command executed can be found in argv[0]. (For Ruby applications, they will be placed in ARGV, for C applications they can be accessed using the argc and argv arguments to main.)

    By default, argv[0] will be the same as the command started. However, if you use following form:

    exec(["alpha", "beta"])
    

    The program alpha will be executed, but it’s argv[0] will be beta.

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

Sidebar

Related Questions

Question: How can I document Ruby code using Doxygen? Disclaimer: I know ruby already
I need to generate a list of sequential numbers. I know Ruby you can
Could anyone suggest a well-documented and well known YAML library for ruby? A book
Using Ruby on Rails, how can I achieve a polymorphic has_many relationship where the
I've multiply heard Ruby touted for its super spectacular meta-programming capabilities, and I was
I'm confused about the world of Ruby Gems. There are several well-known repositories. Which
Curly Bracket languages are well known: ( wikipedia ) Other programming languages can have
I have a command line Ruby app I'm developing and I want to allow
In the Ruby Standard Library we have the Singleton class: http://ruby-doc.org/stdlib/libdoc/singleton/rdoc/index.html We can make
What's the simplest way in Ruby-on-Rails to create several simple hidden fields with known

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.