From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29204 invoked by alias); 23 Dec 2015 17:19:49 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 37427 Received: (qmail 22602 invoked from network); 23 Dec 2015 17:19:23 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,SPF_HELO_PASS autolearn=no autolearn_force=no version=3.4.0 X-Injected-Via-Gmane: http://gmane.org/ To: zsh-workers@zsh.org From: Christian Neukirchen Subject: zsh exec format error with empty files Date: Wed, 23 Dec 2015 18:01:58 +0100 Message-ID: <871tad6qux.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: p5491e0da.dip0.t-ipconnect.de User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) Hi, It is customary for POSIXy shells that executables which result in format errors are interpreted as /bin/sh shell scripts. zsh does this too, but it doesnt work for empty files: zsh 5.2 (x86_64-unknown-linux-gnu) zsh-5.2-0-gc86c20a % ls -l empty colon -rwxrwxr-x 1 chris users 2 Dec 23 17:53 colon* -rwxrwxr-x 1 chris users 0 Dec 23 17:49 empty* % cat colon : % ./colon % ./empty zsh: exec format error: ./empty For consistency, this should just run /bin/sh as well and return 0, like in bash, dash, busybox sh, tcsh, mksh, ksh93, posh, Byron's rc and every tool using execvp. Happy holidays, -- Christian Neukirchen http://chneukirchen.org