From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1519 invoked by alias); 14 Aug 2017 03:20:16 -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: 22823 Received: (qmail 23361 invoked by uid 1010); 14 Aug 2017 03:20:16 -0000 X-Qmail-Scanner-Diagnostics: from mail-qt0-f179.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.216.179):SA:0(-0.2/5.0):. Processed in 4.628874 secs); 14 Aug 2017 03:20:16 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-0.2 required=5.0 tests=RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,RCVD_IN_SORBS_SPAM,SPF_PASS, T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=ZGqW0C0v7Yzh72CQHVnCLUH6ePsDbdHeeTXGm6jXNZs=; b=jqGbwFzGRXYiihUm4jl1cNvUGwKci61qKOcZBhca77LMb7if9Ssmc+ETZzb8uEpZxW lPVqRZPb72si8y+Ldtb8oJAD7QOa1dupO+mp4FdRKw/QMXLdFoOHmNjVX5tt5SbCsERz ExhvSY3+SfD4A+6koatrNZiUH6L+ZWfLlqWUQy7rxGNL/UKElHsMF4DSuM6jOPjVdQKN Iiv2J9OsZ6ID5iY3CMT6PaoudV/kj6FZ9BmPZ4l7QezHw23cSvIthiBe+KJwkgh2jQJM L5w0ZgxG08wAIsK7ESwPBEgBJBOpBIdxZdQYBLfJVVH3XBFcYFzhgswaZYfXSYAsthZO fEHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=ZGqW0C0v7Yzh72CQHVnCLUH6ePsDbdHeeTXGm6jXNZs=; b=i4/Tjto4VqcsmmTEJHbmK7EXFad0ITv6N+un3JRa73fLhuWIZ+Y2CUYtO4uMn7q4vn nS4lPUUcwa/jSwqfKwIMYeINx/rixrtnae1ZhAXEY5CD5GwWgtcGKhKx1uqYeuoVX3c/ Xhh3O5hAnYllBLM+ENhYP0y/CTlnyFk4DUEaeVu/B+rX5I0LmxAGwKbHvSEqsnkb3vQ4 1xULslkj3KjkLM7WcyKxdLx64KpBoZOR9guDhH/dJhpzlxMxx54+Qt5zm68KVFeEsMab G9Yp8wBKJYToBjeC19ZpEWxp0GnyLeuvjmLfbWA5ZX/IV5Ij3M5TPQH40qMnktOCH3IH eA5Q== X-Gm-Message-State: AHYfb5it53WBI2IWMNjB/S7kggexKJ9dVAFvBoeIZiaEpK8Oybsi5Lcm fLqf51+2RpzkGFffN01/N0iHHgNndJDB X-Received: by 10.237.33.162 with SMTP id l31mr30291028qtc.188.1502680805699; Sun, 13 Aug 2017 20:20:05 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1852003c-c07c-dc61-b863-007f0cef9111@eastlink.ca> References: <1852003c-c07c-dc61-b863-007f0cef9111@eastlink.ca> From: Bart Schaefer Date: Sun, 13 Aug 2017 20:20:05 -0700 Message-ID: Subject: Re: PATH_DIRS To: Zsh Users Content-Type: text/plain; charset="UTF-8" On Thu, Aug 10, 2017 at 10:07 PM, Ray Andrews wrote: > On 10/08/17 03:19 PM, Bart Schaefer wrote: >> >> Anyway, it already does search like that. You just have to chmod +x >> the script files (and add a #! line if they aren't zsh scripts). > > However, scripts are run even if chmod -x, tho whence will only find them if > '+x'. Am I somehow missing the boat there? You're confusing scripts read with the "." (or "source") commands with programs that are found by path search where the program happens to be a script. That is, with or without PATH_DIRS set, if you have a script named "myscript" in a directory in $PATH and you chmod +x it, then you can run it by just typing "myscript" in command position, without prefixing it by ". ". With PATH_DIRS set, you can run ". myscript" with or without that executable permission on the file (it need only be readable). When I said: >> What it WON'T do is source scripts it finds that way into the current >> shell. By "that way" I meant "path search where the program happens to be a script." Obviously (I hope), the "." command always does source things into the current shell. > I find myself wanting whence to find anything that is executable on the PATH. Some people use "chmod +x" on scripts exactly for this reason, whether they intend to always run them via the "." command or not.