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.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HTML_MESSAGE,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 21347 invoked from network); 15 Nov 2021 11:41:33 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 15 Nov 2021 11:41:33 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1636976493; b=Zi0LENNk8PObma88oSwKVUsqD31ywQUR5W0KbyvpzNyPhqMUf8My8pQ8XvgWWVJwyWXJh3XWvA PLfGw3hRAXoZhFZrX2HLYO6E/oanibibT1h55HGFp5R+bSFUV+2GDixrcsBPgU7x+AqGdwvg2+ xImEC28IbbyVyqJnCKpSt0szouh/fAb3OEELctrxpqEwd0kjqWpDv9/Qys8o6gjayAPGWtNlDu LquTpt0rcfBbxtD5bFfcamxnaNH5UlFg5TP6WQAbwZeEy4DSSsc1l7HE4A2Rp67Bk2fHtha+pT q7uYijBlC1vMD0SRDm14eHvm08a+c++f82J42ZhZZQqpWw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (w1.tutanota.de) smtp.remote-ip=81.3.6.162; dkim=pass header.d=tutanota.com header.s=s1 header.a=rsa-sha256; dmarc=pass header.from=tutanota.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1636976493; bh=1sI4xiQFRR/IK0tsY263Xg/h7wWQmDrtaq7QeLwTAwU=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:MIME-Version:Subject:Message-ID:To:From:Date: DKIM-Signature:DKIM-Signature; b=OGbp9yOFjQsu+J96bBdvkb2DMA28poEXWniUF2A0Zkjw2U5wUX6jnRJBlAGo/3l8OR0P1WY9/f 4HqstizqvnbNOahJvTT2XMMuVXA00vqRkJM89fK7NfO/Y89YyFz7DmxExurOxApieo5bMrmlmD 19AkDa+b55DZuI5ApKP84s5XTRHSpqZ6iGKUvOXBLuR/8qOVgJRpJS2jXHhbnYAZHm5khpdjum abzxXbEjdAkH65QBqNb0CchXkpNjEyIK9C+ZcQWMWLzpzODdAzGnZxEgSnV829PLPsLO1j5Epq JF8za4Vngh3vYD5XXUz2XHah8BkjEaajT/PJ+fHjvj334g==; 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:MIME-Version:Subject: Message-ID:To:From:Date:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References; bh=WLbZa+xaRduIyQ3CNg1pW7Rye/GeB2wpshThedbCEgg=; b=ZM9V9hLYhav+uhwwMIMoQAN3zQ 3FrFmAwnLGjo4jjG6JBiid4cmPmik2Rti9koZ4YpYDPib2mJGilAZac2nxsXOouG3PLz9+UQR+K9I zLEYtuT0J+4WZguG93rpo0tHpiNt03N1wTZOsaOUCd2CCVlr91X6Z2l4Qll2pGDPB4DrGe9pVzD0P /12YK0Z1e3LCObtHk2r9l7hjCvT4g/F3/RZhaufS26rD/Zv34G4PRlN1p+OL+ErrnVneLC6BX2gFK zhuwnryLatUvc8b4dgyT5/8cYbOIGDR0FPAVoBPM34iEcZbcL03qNSKw8TNPwUBZcEtXB1aM7OnGD 1exALryg==; Received: from authenticated user by zero.zsh.org with local id 1mmaMe-0007Kt-Qs; Mon, 15 Nov 2021 11:41:32 +0000 Authentication-Results: zsh.org; iprev=pass (w1.tutanota.de) smtp.remote-ip=81.3.6.162; dkim=pass header.d=tutanota.com header.s=s1 header.a=rsa-sha256; dmarc=pass header.from=tutanota.com; arc=none Received: from w1.tutanota.de ([81.3.6.162]:40462) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1mmaLw-000711-EW; Mon, 15 Nov 2021 11:40:49 +0000 Received: from w3.tutanota.de (unknown [192.168.1.164]) by w1.tutanota.de (Postfix) with ESMTP id 9C713FA07D5 for ; Mon, 15 Nov 2021 11:40:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1636976447; s=s1; d=tutanota.com; h=From:From:To:To:Subject:Subject:Content-Description:Content-ID:Content-Type:Content-Type:Content-Transfer-Encoding:Cc:Date:Date:In-Reply-To:MIME-Version:MIME-Version:Message-ID:Message-ID:Reply-To:References:Sender; bh=WLbZa+xaRduIyQ3CNg1pW7Rye/GeB2wpshThedbCEgg=; b=3t/lnt9VVQ3GVxGPPoYHcOHdegTmi5pHoeMHU0S4pPsSjZTszdcV4vq+0ypDZJBa Rsc09vSoe0q3OGTzMHwX0sT1GW/D+agfYPC/gZawzBkHhnzrKj3ntmScwre2HgioKas tAqAAw0k85O2mL83hXDJh1LVB423aBr6spUUZdDA0hOPZfB/v4/cz2eYq/Ckn/u2vWO Ugb+LJ3YO4EHJLYjYpUuu7xNMre4zfge0+IYQGQoMBS1g58JAjeU+16CkMmIBM0gIUJ yBXM2g4q3owPA95JT5+7eWERA47Fxj+2l0eVsWVDAjX6CZB63JK1J1U71VEJS7sbEQJ GV6QwP80EA== Date: Mon, 15 Nov 2021 12:40:47 +0100 (CET) From: aismtnt@tutanota.com To: zsh-workers@zsh.org Message-ID: Subject: Command execution MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_983996_84166659.1636976447618" X-Seq: 49587 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: ------=_Part_983996_84166659.1636976447618 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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. ```zsh # Create file. echo 'echo "Hello world"' > my_script # Run file. my_script zsh: command not found: my_script ``` ------=_Part_983996_84166659.1636976447618 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit


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 shell script. /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.

```zsh
# Create file.
echo 'echo "Hello world"' > my_script

# Run file.
my_script
zsh: command not found: my_script
```
------=_Part_983996_84166659.1636976447618--