Re: behavior of "echo"
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