• 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: Differences in output between AppleScript and Terminal
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Differences in output between AppleScript and Terminal


  • Subject: Re: Differences in output between AppleScript and Terminal
  • From: Christopher Stone <email@hidden>
  • Date: Sun, 12 Mar 2017 01:03:23 -0600

On Mar 10, 2017, at 14:30, debt <email@hidden> wrote:
Anyway, running the Perl script in Terminal works the way I expect it to.  Running the script in BBEdit works the why I expect it to.  But calling it from AppleScript doesn’t.  I guess I just don’t understand why AppleScript has to be the odd man out when it comes to this.


Hey Marc,

I suspect you should read Technical Note TN2065: do shell script in AppleScript.

Do shell script by design runs a completely unadulterated shell session.

The easiest way around this is to source your ~/.profile or ~/.bashrc or whatever file your shell customizations are in.

----------------------------------------
do shell script "
source ~/.profile
/usr/bin/env perl -e 'print \"$^V\";'
"
----------------------------------------

That should reproduce the environment you're accustomed to in the Terminal.

--
Best Regards,
Chris

 _______________________________________________
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: Differences in output between AppleScript and Terminal
      • From: debt <email@hidden>
References: 
 >Differences in output between AppleScript and Terminal (From: debt <email@hidden>)
 >Re: Differences in output between AppleScript and Terminal (From: debt <email@hidden>)

  • Prev by Date: Re: Posix Path
  • Next by Date: Question on keywords
  • Previous by thread: Re: Differences in output between AppleScript and Terminal
  • Next by thread: Re: Differences in output between AppleScript and Terminal
  • Index(es):
    • Date
    • Thread