• 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: Inconsistancy Between Do Shell Script and Terminal?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Inconsistancy Between Do Shell Script and Terminal?


  • Subject: Re: Inconsistancy Between Do Shell Script and Terminal?
  • From: Christopher Nebel <email@hidden>
  • Date: Fri, 14 Jan 2005 17:07:37 -0800

On Jan 13, 2005, at 5:42 AM, de Runtz, Lars wrote:

It is important to declare the shell environment, at the top of shell scripts.

#!/bin/bash

for the bourne again shell. The do shell script may actual default to another similar environment, like tcsh. Different MacOS's may default to different shells, too.

Not as far as "do shell script" is concerned, it won't. Quoting from TN2065 again: "do shell script always uses /bin/sh to interpret your command, not your default shell, which Terminal uses." While it's true that your default shell may be anything, and it's true that the default for new users has changed between releases, that only affects Terminal, not "do shell script". Technically, sh is really bash running in sh emulation mode.


I think I put my #!/bin/bash in my scripts because I encountered funny problems, and declaring it solved them.

Most likely you were trying to use bash-isms that aren't supported (correctly) in sh mode.



--Chris Nebel AppleScript Engineering

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Inconsistancy Between Do Shell Script and Terminal?
      • From: Bill Briggs <email@hidden>
References: 
 >RE: Inconsistancy Between Do Shell Script and Terminal? (From: "de Runtz, Lars" <email@hidden>)

  • Prev by Date: Re: Tar/gzip is messing up icons
  • Next by Date: Re: Inconsistancy Between Do Shell Script and Terminal?
  • Previous by thread: RE: Inconsistancy Between Do Shell Script and Terminal?
  • Next by thread: Re: Inconsistancy Between Do Shell Script and Terminal?
  • Index(es):
    • Date
    • Thread