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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T16:47:33+00:00 2026-06-14T16:47:33+00:00

Background: We are developing an in house use only cocoa app to help us

  • 0

Background:

We are developing an in house use only cocoa app to help us with some basic sysadmin tasks and complex website deployments. This application is basically a wrapper around many different bash shell commands. The output from these commands will sometimes need to parsed or displayed to the user.

We have played around with NSTask and are able to launch some scripts. However, this seems somewhat cumbersome (needing to set the exact path, passing in each argument separately, etc…). We can use NSTask in this way if this is actually the preferred method.

The biggest challenge so far is setting up the shell environment. We interact with many ruby gems and programs and deploy using capistrano.

The Question is:

How can we interact with the shell with an environment setup like a user? (aliases, rvm, ruby, paths)

  • 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-14T16:47:34+00:00Added an answer on June 14, 2026 at 4:47 pm

    The environment variables you’ll see set in your shell in Terminal.app are pretty much confined to whatever shell you’re using in the Terminal context. It’s not picked up by “NSTask” automagically.

    But… you do have options. Some of them are described in answers to this related question.

    You can set more universal environment variables that do get picked up by NSTask via the “~/.launchd.conf” file, or you can set the shell of “NSTask” to match the one in Terminal (which means you pick up .bashrc or .profile or whatever initializes paths) via “[NSTask setLaunchPath:]” (where the launch path is your shell).

    And of course you can also call “system()” from within your tools. This may also pick up the variables set in the “~/.launchd.conf” file.

    More information on environment variables is available in this question.

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

Sidebar

Related Questions

Background This is only my second PyQt4 project. Developing a Windows app that has
I am developing in rails and have some programming background. I'm looking for help
Background We are developing some in-house utilities using ASP.NET 2.0. One of which is
First, some background: I'm developing a web application using Python. All of my (text)
I am developing a small app in which I want a background service to
I learning Python (coming from a dotnet background) and developing an app which interacts
Background: I'm developing Greasemonkey scripts for a website. I do not control the Flash
Background I am developing a social web app for poets and writers, allowing them
Background: I am developing an app which sends an SMS to users after registration
A little background I'm developing a large-scale JS app with ExtJS3. At runtime, 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.