• 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
how to refer to environment variable in a Terminal do script?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

how to refer to environment variable in a Terminal do script?


  • Subject: how to refer to environment variable in a Terminal do script?
  • From: Gonzalo Castro <email@hidden>
  • Date: Fri, 30 Nov 2007 15:14:37 -0500

Is there a way to refer or "pass in" a shell's environment variable to a Terminal do script ?

For example, the toolToRun below requires the DISPLAY environment variable to be set in the shell in which it will run. How can I pass in the value of the calling shell's $DISPLAY variable?

#!/bin/sh
export $DISPLAY=:0.0
osascript -e 'tell app "Terminal" to activate' -e 'tell app "Terminal" to do script "/path/to/toolToRun"'



As expected, the "export $DISPLAY=:0.0" line above doesn't work since the calling shell is a different process than the shell spawned by the "do script".


Thanks,
Gonzalo
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
  • Follow-Ups:
    • Re: how to refer to environment variable in a Terminal do script?
      • From: Skeeve <email@hidden>
  • Prev by Date: Re: Idea for better handling of mailinglists
  • Next by Date: Re: how to refer to environment variable in a Terminal do script?
  • Previous by thread: Re: Leopard Server vs. Client [OT]
  • Next by thread: Re: how to refer to environment variable in a Terminal do script?
  • Index(es):
    • Date
    • Thread