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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:44:52+00:00 2026-06-15T12:44:52+00:00

I’ve run into a weird problem with /usr/bin/env … I designed a simple script

  • 0

I’ve run into a weird problem with /usr/bin/env… I designed a simple script to show the problem. The script is in Ruby, but the same happens with a similar script in Python. Here is the script:

#!/usr/bin/env ruby

p ARGV

And another one without /usr/bin/env:

#!/data/software/ruby-1.9.2-p180/bin/ruby

p ARGV

As you see it should just print script arguments. An it works flawlessly on the head node:

[gusev@scyld test]$ which ruby
/data/software/ruby-1.9.2-p180/bin/ruby
[gusev@scyld test]$ ./script.no_usr_bin_env.rb 1 2 3
["1", "2", "3"]
[gusev@scyld test]$ ./script.usr_bin_env.rb 1 2 3
["1", "2", "3"]

But when running on computing node, it gets stuck:

[gusev@scyld test]$ qsub -d $(pwd) -I
qsub: waiting for job 176427.scyld.localdomain to start
qsub: job 176427.scyld.localdomain ready

-bash-3.2$ ./script.no_usr_bin_env.rb 1 2 3
["1", "2", "3"]
-bash-3.2$ ./script.usr_bin_env.rb 1 2 3
<stuck>

/usr/bin/env are exactly the same on both machines:

[gusev@scyld test]$ md5sum /usr/bin/env
7ada476000967f2e4cca2bc669045479  /usr/bin/env
[gusev@scyld test]$ qsub -I -d $(pwd)
qsub: waiting for job 176428.scyld.localdomain to start
qsub: job 176428.scyld.localdomain ready

-bash-3.2$ md5sum /usr/bin/env
7ada476000967f2e4cca2bc669045479  /usr/bin/env

I know that argument processing with /usr/bin/env can be tricky. But we have a lot of software using this and we cannot just fix them all. Is there anything I can do to fix this?

  • 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-06-15T12:44:53+00:00Added an answer on June 15, 2026 at 12:44 pm

    #!/usr/bin/env ruby causes the script to be executed by the first ruby executable in $PATH. Your $PATH could be different on the compute node, most likely because of the way the environment is set up by qsub.

    A quick and dirty fix would be:

    PATH=/data/software/ruby-1.9.2-p180/bin:$PATH ./script.usr_bin_env.rb 1 2 3
    

    but you should find a cleaner way to ensure that $PATH is set correctly before your Ruby scripts are executed.

    For more detailed information, try which ruby or type ruby and echo $PATH on the compute node, and make sure that the ruby command actually works.

    (For more discussion on #!/usr/bin/env ... vs. #!.../ruby, see my answer to this question).

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am currently running into a problem where an element is coming back from
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a French site that I want to parse, but am running into
I've tracked down a weird MySQL problem to the two different ways I was
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
this is what i have right now Drawing an RSS feed into the php,

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.