From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4077 invoked by alias); 11 Jan 2014 23:55:25 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 18322 Received: (qmail 17909 invoked from network); 11 Jan 2014 23:55:19 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,T_TO_NO_BRKTS_FREEMAIL autolearn=ham version=3.3.2 Message-ID: <52D1D9DE.1000201@gmx.com> Date: Sat, 11 Jan 2014 18:55:10 -0500 From: Eric Cook User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: zsh-users@zsh.org Subject: Re: Trailing whitespace after $'\0' with external commands References: <52D1C33A.7080803@gmx.com> <140111153552.ZM14759@torch.brasslantern.com> In-Reply-To: <140111153552.ZM14759@torch.brasslantern.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:y29AheSNYRhaeRwY7KpoWhfWi5MQ9Bn/7nz+SeLt0Bfw6LXO3wi nU2Ggum2XiAqSR0qB6szZU/2fdVHmfJ4ANbLwRefJqAEvD2ZBIucz+ZhkzXuW3yi4qQneSL miT/vFnhJqe/aBp9NxZNE3dA7cp1kl/xBHl7MywHTx9DSCPctojVELlBXuGNxNOhrVqJlp+ S6W3591ZKkKflepnS69Og== On 01/11/2014 06:35 PM, Bart Schaefer wrote: > I can only conclude that ksh is not actually retaining the nul byte in > the argument list when calling /usr/bin/printf. There's an argument > (no pun intended) to be made for this behavior, in that it's impossible > for a string passed through the argv mechanism of execve and friends to > contain an embedded nul; the string will always end at that byte, so > ksh assumes it knows better than you and removes it so that the called > program (/usr/bin/printf in this case) can see the "whole" string. > > Conversely, zsh is just doing *exactly* what you told it to do. Ah, thank you for explaining it.