• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Invoking command line commands with environment variables set
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Invoking command line commands with environment variables set


  • Subject: Invoking command line commands with environment variables set
  • From: Terje Tjervaag <email@hidden>
  • Date: Tue, 5 Aug 2003 10:54:42 +0200

A different problem now,

I want to invoke a command line program (ly2dvi from GNU/Lilypond actually) through NSTask (or are there better ways of doing it?), but this program needs some environment variables set for it to work. These are set up when scripts from /etc/profile.d are run, and so I assume they are run every time I start a new terminal.

ly2dvi starts up fine, and I am able to supply it with arguments, so my problem is not with invoking NSTask (I am using launchedTaskWithLaunchPath:). However, ly2dvi is a script I think, and it bombs halfway through with a 'command not found' message, presumably due to the missing environment variables.

Anyone have an idea on how this can be solved? Maybe I could run ly2dvi from within a shell through NSTask somehow, but I don't know how to do this (I attempted sh as the command and ly2dvi as the argument, but that didn't work).

Thanks!

Terje
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Invoking command line commands with environment variables set
      • From: James Quick <email@hidden>
References: 
 >Two views responding (From: Terje Tjervaag <email@hidden>)

  • Prev by Date: Two views responding
  • Next by Date: Re: compiler warning
  • Previous by thread: Two views responding
  • Next by thread: Re: Invoking command line commands with environment variables set
  • Index(es):
    • Date
    • Thread