• 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
Re: Multi-line do shell script. How?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Multi-line do shell script. How?


  • Subject: Re: Multi-line do shell script. How?
  • From: Graff <email@hidden>
  • Date: Thu, 22 Apr 2004 00:14:02 -0400

On Apr 21, 2004, at 5:52 PM, Christopher Nebel wrote:

On Apr 21, 2004, at 8:23 AM, Graff wrote:

If all you want to do is to check your environment variables then just do this:
do shell script "declare"

Maybe on your system, but not a standard one. Try 'do shell script "set"' instead.

Ahh ok. I'm mostly a tcsh person so I'm used to using setenv. I got the "declare" command from the bash man pages and when I tested the command it did give me a listing of all my environment variables so I figured that was it. Funny though, I just tested both "set" and "declare" and they seem to output the same thing. I don't think that I've changed anything in my bash setup so I don't know why my bash would be different than other people's. I am sure that I'm only using the version of "declare" that is built into bash.

Hmm, one thing I noticed was that the command "/usr/bin/env" works fine in both environments. The only thing is that it doesn't seem to show every environment variable under bash. Is there any good reason why it only shows some of the environment variables?

If you want to know the value of any single environment variable, such as PATH, you can do:
do shell script "echo $PATH"

Of course, this gives you your environment as sh knows it; you can use 'system attribute' to get the environment as the application knows it. (sh adds a bunch of its own stuff.) For example, 'system attribute "PATH"' returns your PATH; 'system attribute' with no parameters returns a list of all defined variable names.

Right, I'm so used to using the shell for this that I forgot that the "system attribute" command will give you environment variables also.

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


  • Follow-Ups:
    • Re: Multi-line do shell script. How?
      • From: Nigel Smith <email@hidden>
    • Re: Multi-line do shell script. How?
      • From: Doug McNutt <email@hidden>
References: 
 >Multi-line do shell script. How? (From: Simon Forster <email@hidden>)
 >Re: Multi-line do shell script. How? (From: Graff <email@hidden>)
 >Re: Multi-line do shell script. How? (From: Christopher Nebel <email@hidden>)

  • Prev by Date: Re: Multi-line do shell script. How?
  • Next by Date: Re: How to use "do shell script" to search for RegExps
  • Previous by thread: Re: Multi-line do shell script. How?
  • Next by thread: Re: Multi-line do shell script. How?
  • Index(es):
    • Date
    • Thread