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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T08:38:40+00:00 2026-06-06T08:38:40+00:00

I need to Load RVM into a shell session as a function , so

  • 0

I need to Load RVM into a shell session as a function , so I execute this script in my zshrc.

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" 

However, this script will slow me down about 1 seconds whenever I launch a new terminal. So I figure out a solution which put this script to background job like this:

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" &

Then I got a quick launch time when I launch a new terminal. But I’ll see this message:

[1]  + done       source "$HOME/.rvm/scripts/rvm"
  1. Is there a better way to make this script don’t slow down my terminal launch time?
  2. how to suppress this “done” message when this background job done ?
  • 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-06T08:38:41+00:00Added an answer on June 6, 2026 at 8:38 am

    This will not work for things like rvm. rvm relies on being able to manipulate your current shell’s environment (define its own shell functions etc). When you put a job in a background it is run in a sub-process that has no effect on the current shell. Example:

    [0 mbunkus@chai-latte ~] print $some_var
    
    [0 mbunkus@chai-latte ~] cat the-file
    some_var=some_value
    [0 mbunkus@chai-latte ~] source the-file &
    [1] 17090
    [0 mbunkus@chai-latte ~]
    [1]  + done       source the-file
    [0 mbunkus@chai-latte ~] print $some_var
    
    [0 mbunkus@chai-latte ~] source the-file
    [0 mbunkus@chai-latte ~] print $some_var
    some_value
    

    If rvm is too slow for you then you could also check out rbenv which does something similar to rvm but with much less shell magic.

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

Sidebar

Related Questions

I need to load a custom function from an extern file but without causing
I need to load data into my treestore. My ajax request give me XML
I need to load a .xml file from a URL adress into an NSData
I need to load a file from an umounted TrueCrypt disk into memory. Is
I need to load an XML source using Simple XML, duplicate an existing node
I need load XNA.Texture2D to PictureBox. i've tried this: http://www.gamedev.net/community/forums/viewreply.asp?ID=3224621 but it doesn't work.
I need to load a list of database row objects into memory, and then
I need to load data from different remote database into our own database. I
I need to load the contents of several arrays into a list depending on
I need to load a variable number of javascript source files before running javascript

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.