From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 1967 invoked from network); 15 Nov 2021 13:33:51 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 15 Nov 2021 13:33:51 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1636983231; b=fMdiFHLf/bwGtKXhzRHAwpWT3z6bQ6gU76C1JZmzNl+KeZj4Q66dOLVgZ8JWWGhk1K+t23cuSu MhoXfho/QLmvmm6ZgtOhFLueC9DGo45XzDmpRIUVVD7ZI1MvhsQzaXRgTZ6gRxz/bvQR7QxB2Z Onfcu/9CCO4vopNZ7Nfp39nEviq4IjkfwF0JZkkt/usinQ6pjH8Pu7BLkgzvQhD0/vT2evXivi EG7vIVOtvMdfpUnAqeDnAT9OMKAitCuqwitX1tzrXn4ikwolYcRUt5iTqPxdTobfZb1gcVbu/J CHYiXFrZuuohbjeXx1XqCKVI7oR5CavFjxQ4kldHoXZeqw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ua1-f44.google.com) smtp.remote-ip=209.85.222.44; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1636983231; bh=U4INZ0aorKztoc5DNr3O2DPeFSip79CDbTM5gBHJ54Y=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:References: In-Reply-To:MIME-Version:DKIM-Signature:DKIM-Signature; b=Z1eabjAlEopAJNv8+eF66gc8M2k3uxfDck/66y9LRvyb9sGfg5+gFXDgU2aZmje/tmqJ/jT2F1 0cZ4j/WQEr0bywwJUQxXJ3PuaKMGMW0CfgPx5Rt297X9Io49Z8pcDsTXu8ejp81A/AeC7czvjW aYaZSPHIFeoOlIBJ4lwEIu6Advx+yg9otma+VS+7L1hWpNFu8a1V/zrB/GNkju2PWn3UeQDSRn f5HKaGh7sy5+8dO+TjU+LnSc2aL+7WOKu3uDNoaBIXyHYv4vg461GwqEWt1u3aeGc0sEy5cU3J D2imFLol5QfuZdGD3tatqsLLgVIoVju4qOXgPFjAmrjMLQ==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID :Date:From:References:In-Reply-To:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=f93+tb18DU8xwiabA6XTdcv5z+WIf+sBZoPPDUJNtL8=; b=WvwClfLtqdOfmvrLIeBrlG7YXP IwSWRhVMWClbOz/VFoumuGnXt65OCUWmjZQ0d62sYLmdT14WrehUiAA1f9Rz6jEHkhCxZzzYPRlqH WTk16JoSv8Sx6Ww6XkjLoMaF9MBWKf4qr4l1UhgCWed8IzMjXHm6FA+tioC1Xvq/ZEhH9wk7wxlUL /zEiVsKYz5X6pCH6cjcKwiy4iUN1W3D3WvD6skTb0h0dAIRAvUtMEziB7YZW0e0ckCG034h5/OD3/ OVb3b1wGi942hHxe+dlMC1ujAtpiZPryQrQjgZH0L7OPZLLVUtbmn9dhcjCrVOlez5g9kL2rMeXNj ejBwJrXA==; Received: from authenticated user by zero.zsh.org with local id 1mmc7K-000AJ8-Bf; Mon, 15 Nov 2021 13:33:50 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ua1-f44.google.com) smtp.remote-ip=209.85.222.44; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-ua1-f44.google.com ([209.85.222.44]:39483) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1mmc70-000A2A-OC; Mon, 15 Nov 2021 13:33:31 +0000 Received: by mail-ua1-f44.google.com with SMTP id i6so34828849uae.6 for ; Mon, 15 Nov 2021 05:33:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=f93+tb18DU8xwiabA6XTdcv5z+WIf+sBZoPPDUJNtL8=; b=lgEkeIvhN1QlLdZoH8z6bsA2LwHTDHjuhpqV+izEICAwboeUra232r85td/ubEUsyL 5GvVJO4Eb2vu4ix5GrakoKsyCkifvh8KKDE0ICEFtqTdYKgYfYMQ3CE7Mk44Hqukdayb z0r1UDp9en0WSCHKFmwbmFYH8zv8xYIA2zJ+jw7tVjJ/+wQnUyadyN2Bi5PA4LH3cu0h NUl2NFhIn7ByKiAoHBq+a1K88SgDozTvA8mQdZeWVny8n/Z34FU5OFq5rwAgbOM9nAhT ZjjTyQWofMQdw/QevkT7aSt2B6O2yUFIZzmsutsPcF1dS0uOwzxXi2iSOwHiPyFRya/g rUOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=f93+tb18DU8xwiabA6XTdcv5z+WIf+sBZoPPDUJNtL8=; b=K/j+LG/JPxWaqDPEYwxWkJiMtFJHhdaxviCa95vsXEuF04E+x9wxYJt3zW2lPz+0LS OaPdSPQKfzQ/zEBKG5ljRQwfsS1vb6miMmMN1IO7fxcTIRSvchhovM4WGtRV+imLu4ax Yf/dbKoYprIh8nCJ+RrjGiAvoTOrdNFfjWmayFo+ITLKl7/ULkmillOBgj36O85Q2egU +xyAuHddN4lKmMewWJUA3/OdEiVghrbAaKpZmSMXNqU9xd1G//dRFuQDSNyltIhPESnC 5FyKX4WYeEicTvULtspM0hmVd3/5Z3pAzf2F7h7nsVO1mBeDAxqTNJFtJhrHk0DoJDpZ WtMg== X-Gm-Message-State: AOAM533EmKwgc/0d14R/PJzDMzfLfk8bWVZXQAA28dP6m2Q3wlM4YpFe EYyMJ3XuGEnpRRYtPDdhedqddSVzlmkBDBg6cx8= X-Google-Smtp-Source: ABdhPJxw2GFS787v2z8rDV6EKgRmPJzvXnor9pbckchi3HBRr/kkQshMH9P5qaMphmtnkUffnaE2g3iOwBL0PuugdPg= X-Received: by 2002:ab0:4324:: with SMTP id k33mr59595237uak.43.1636983209060; Mon, 15 Nov 2021 05:33:29 -0800 (PST) MIME-Version: 1.0 Received: by 2002:ab0:2a82:0:0:0:0:0 with HTTP; Mon, 15 Nov 2021 05:33:28 -0800 (PST) In-Reply-To: References: From: Mikael Magnusson Date: Mon, 15 Nov 2021 14:33:28 +0100 Message-ID: Subject: Re: Command execution To: aismtnt@tutanota.com Cc: zsh-workers@zsh.org Content-Type: text/plain; charset="UTF-8" X-Seq: 49588 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: On 11/15/21, aismtnt@tutanota.com wrote: > > Documentation: > https://zsh.sourceforge.io/Doc/Release/Command-Execution.html > > There is a statement in docs: > > 'If execution fails because the file is not in executable format,and the > file is not a directory, it is assumed to be a shellscript. /bin/sh is > spawned to execute it.' > > I wonder if it's true or maybe I'm missing something. > > My understanding is that if I create a file with shell commands but won't > change its mode to executable, it will still be executed, because it is > assumed to be a shell script. > > But it does not. "executable format" refers to the contents of the file, eg will the kernel exec()ute this, and "executable mode" refers to the mode of the file, they are not the same thing. The quoted statement only applies if execution failed because of the file contents not being a valid executable format, but in your case the execution failed because of missing permissions (earlier check), so the statement does not apply. -- Mikael Magnusson