• 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: behavior of "echo"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: behavior of "echo"


  • Subject: Re: behavior of "echo"
  • From: Christopher Nebel <email@hidden>
  • Date: Mon, 18 Jan 2010 13:49:25 -0800

On Jan 18, 2010, at 8:00 AM, Mike Hurley wrote:

> In ASOC echo -n no llonger works to suppress the final newline.  Apparently there was some change in  the way that echo is implemented in the shell used by do shell script.

The change in "echo" has nothing to do with ASOC, it has to do with changes made to sh(1) in Leopard for POSIX compliance.  (If you didn't know that "do shell script" uses sh(1), you should read the "do shell script" tech note.)  There are three different workarounds:

1. add a trailing "\c" (properly escaped in AppleScript, of course); this is documented in the sh(1) man page under the "echo" built-in.
2. use "/bin/echo" instead of "echo" -- it still supports the "-n" option.
3. use "printf" (technically, /usr/bin/printf), which doesn't implicitly append a newline.


--Chris Nebel
AppleScript Engineering

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

This email sent to email@hidden

References: 
 >Re: Creating/saving/appending to files the Cocoa way (From: Mike Hurley <email@hidden>)

  • Prev by Date: Re: Creating/saving/appending to files the Cocoa way
  • Next by Date: Re: NSSavePanel oddity
  • Previous by thread: Re: Creating/saving/appending to files the Cocoa way
  • Next by thread: Re: Creating/saving/appending to files the Cocoa way
  • Index(es):
    • Date
    • Thread