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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T02:25:51+00:00 2026-05-16T02:25:51+00:00

how could I run a ruby script as a command in linux. I have

  • 0

how could I run a ruby script as a command in linux.

I have this script which access the lib but i have to run it as

teraData.rb

i want to run it as teradata (or some meaningful command ) with args on linux from any command promt.

Where should i place the script and what should I do?

I am kinda new to linux so please help

  • 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-16T02:25:52+00:00Added an answer on May 16, 2026 at 2:25 am

    If the script is executable and the first line of the script is #!/usr/bin/ruby (or whatever the path to your ruby interpreter might be), then you should be able to launch the script directly (i.e. $ ./myscript.rb).

    Otherwise, execute the interpreter and pass it the script as an argument (ruby ./myscript.rb).

    If you want to run the script from anywhere using a simple command, wrap one of these methods in a bash function like so:

    function teraData {
        ruby /path/to/script/teraData.rb $*
    }
    

    Place this function definition in your .bashrc file to have it automatically loaded whenever you open a shell.

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

Sidebar

Related Questions

I want create a ruby script that I can run on the command line
I read somewhere that somebody could access a config value during run time but
I have to run a whole bunch of ruby scripts to generate some results.
When I run a ruby script, it gives me this: [nathanb@nathanb-box ~] myscript .
I have a Ruby script that I wrote that sorts some files in a
I have written a ruby script which opens up dlink admin page in firefox
i discovered a problem when cron tries to run a ruby script which uses
I am pretty new with SQL and i have to translate this ruby script
I want to build an application using Quicktime ActiveX interop that could run on
I have spent much time looking for a special package that could run the

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.