• 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: do Shell Script & shell Script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: do Shell Script & shell Script


  • Subject: Re: do Shell Script & shell Script
  • From: Christopher Nebel <email@hidden>
  • Date: Mon, 23 Oct 2006 09:50:21 -0700

On Oct 23, 2006, at 7:21 AM, Mark J. Reed wrote:

OK, I inadvertently sent a chain of stream-of-consciousness replies
directly to Kim and not to the list, which is just as well for most of
you. :)  Here's the upshot:

1. "do shell script" defaults to a "shell" of /bin/sh, which doesn't
have process substitution, hence the need to invoke bash explicitly.
(tcsh also doesn't have process substitution, which is why it didn't
work in Andrew's Terminal session.)

2. /bin/sh on OS X (at least since Panther) is in fact bash in
"sh-compatible" mode - which, like vanilla sh, doesn't have process
substitution, so (1) still applies.  However, *unlike* vanilla sh,
bash in compatibility mode has both the "source" command and
tilde-substitution.  Which is why the "source ~/.profile" line worked.

3.  A more compact way to achieve the desired result is to tell bash
on the command line that you want it to run the .profile, which you
can do via the --login option:

do shell script "bash --login -c 'ls >(ls)' "

<http://developer.apple.com/technotes/tn2002/tn2065.html> would have answered the first two points directly and the third indirectly. If you plan to be using "do shell script" on a regular basis, you should probably read it.



--Chris Nebel AppleScript Engineering

P.S.: I still don't understand what that command is supposed to do, but then I've never understood named pipes, either.
_______________________________________________
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/mailman//archives/applescript-users


This email sent to email@hidden
  • Follow-Ups:
    • Re: do Shell Script & shell Script
      • From: "Mark J. Reed" <email@hidden>
References: 
 >do Shell Script & shell Script (From: "Kim Hunter" <email@hidden>)
 >Re: do Shell Script & shell Script (From: Andrew Oliver <email@hidden>)
 >Re: do Shell Script & shell Script (From: Kim Hunter <email@hidden>)
 >Re: do Shell Script & shell Script (From: "Mark J. Reed" <email@hidden>)

  • Prev by Date: Re: Get filestructure in a variable
  • Next by Date: Re: do Shell Script & shell Script
  • Previous by thread: Re: do Shell Script & shell Script
  • Next by thread: Re: do Shell Script & shell Script
  • Index(es):
    • Date
    • Thread