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, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 11712 invoked from network); 3 Apr 2023 16:50:40 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 3 Apr 2023 16:50:40 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1680540640; b=MEwg5wDIKmVRLtMf4DpS6NJLE3+P63ydw4yJzHt7XgfaUpxDb47QbvM3+OwcIpRNlJ6prbZcLB mL6xoKJft222ScdOEfmxNHk+x9oOaCQ1Af+MjD1dOj1xMaBDvOMV/UXoHPCTnrEKHnjUfJwv0D yLvy9jQrvMhYhF6BqS3E9mKG8ZPLrkgTr/jtqbbuiq/GCvIkT1NAMlGt/f6NhQL5+IY4qUhGJ6 wBeOYPOuYdWzlo9ZqzyN32Ijc2pCf9CGglrm2bxvEQvTUBz5wAmClntStEoYKDP7xU+KJU0z7P xNpGZNXEhAX5zqpZqLCeFoyuMIcg6xo8oCj0h17NXe7Pew==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ed1-f45.google.com) smtp.remote-ip=209.85.208.45; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1680540640; bh=Umkto6R2vNOTRLudCL6/uDNfa1jFv/wZ8Pj7foY3PRQ=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:Cc:To:Subject: Message-ID:Date:From:In-Reply-To:References:MIME-Version:DKIM-Signature: DKIM-Signature; b=Q++K6Lg1xdX+/XHOTVtqxGwDIhkkch6n2BKCxSiGP6vRoUXi3TMIu5CcQDS2yM84QawRD1Rj5h rn0fdwABipo39OmD64ANhJFUvNSWwHJIwr7U+tA87Hkk5CTioltZ5BXoCZ4/4kmxX/HZpuAeO/ RbqMxnS2AruhjKdlUmXo3LbHciCeBuI23jHXSCn+2Wjjk8huBeD4qrwVhuKFcfqNap3c7Yvs6k qyJUTph2j3BFnRKitIH3mblLXDQMrae3GfjNgPWXYA0MOJmupGOGnkNB6O+1nnxY6dmWvo1AiS mV3qhscQSP8IRaB1znlhpLubp4N8d4rzjBmWwrJccX2Gzw==; 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-Transfer-Encoding: Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=Umkto6R2vNOTRLudCL6/uDNfa1jFv/wZ8Pj7foY3PRQ=; b=BGXbsE6fY2AqRF36mcEecPyGRg PKF+34Q/iSXoI5N+Bn1cp09vx5R5iG7QXH2xAscPPJEXB6njnUidFYIbGffvLz6kuCOrT+OiBV3K/ Tz0mVun9FyWQTaXdRw6jT+9ZndVlEs+WTMEyPfAQODDczX6tkZCbLgal2M3DoCUw9s8qxkCX93oRD rMR2nfAWBsmhyv/0nz/bKu/KbaBr7lLMxYdeML2mOtq7eu0d2rwPlT+4YUlW8HadTCDCn14M3bZiW lUxqLiNQshzCSUJq31GWfTaspiJ7TAP0BgLkTUnG6eGSSa6UjOFK1FQCepz1TGGdxB9t/gz09r5qY r2RcZn+Q==; Received: by zero.zsh.org with local id 1pjNOB-000PYh-Tw; Mon, 03 Apr 2023 16:50:39 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ed1-f45.google.com) smtp.remote-ip=209.85.208.45; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ed1-f45.google.com ([209.85.208.45]:39927) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1pjNNv-000PEp-D7; Mon, 03 Apr 2023 16:50:24 +0000 Received: by mail-ed1-f45.google.com with SMTP id ek18so119942599edb.6 for ; Mon, 03 Apr 2023 09:50:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20210112.gappssmtp.com; s=20210112; t=1680540623; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Umkto6R2vNOTRLudCL6/uDNfa1jFv/wZ8Pj7foY3PRQ=; b=2TgYcgIZl67O63H5aWHw/E2LLA8P3GW3A6QlHCRCN4yz+hqtrxmPE+L4l/mJbjGjmp okfAogNiG5Bes+y239qV4QEEVBDikkacb5Ww1Ds4eLPkUdKV43awItAmQ8NWWrEK2jsW xSDZ3vE3U+nfCsL2RHRHfk8pb7L0xLa2Vz+DaDcVGFtcw7eetulXzqFtemXT4SEFkS4x 9qvq/+FJYx7IQvjfNsEr9HNkAE79muGB8jsvQGwWksS1dtDbFCMhdUWZMNnd1H2r4REu Hu8S37vZekKBlfUHvUvgnPQVj3uRQI1NuIrxNUA2rFTHX+tfcB9PX8hkKoLVEpsQjF8p bFuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680540623; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Umkto6R2vNOTRLudCL6/uDNfa1jFv/wZ8Pj7foY3PRQ=; b=FaQyDGIKm1LfcmXJY53OD0owaSln16IgZrOi1gL5Bh8oBy65oSAEAg9308FXd8FpcO byRNtLOYeJP4N2zIBQtSqg7K7FIGsvp7qamxs7te9OTV5efUTfptCgi3j1VcQFalBrz8 U0URUYJtylvIDkPVDMfovCb5T3AZy36Glil08VME4qBiII0qeKmQiK1wd3WFU/Q3C+XR Jt+qSqq/qjEk5/ExcTm0ru2sImNznIARDiXU/aD2KB7benWwioFGSgvUiekHyiQnr7pt PymKp4McJNb5DSLBKN46IqAMMe+3ecojHgTZojnZLOEvdADdZTfPwT/fl8D/pquhG8fx kRtg== X-Gm-Message-State: AAQBX9fVJzzvi1J4ZQmc+SZDifYUduIsfyaUwbtOyg/mlFat5oKSc78D i3WUy92UXLHzITp+/7k1uNjsHKb06vKBg7lgap0G78WJPM4Gh0Gd X-Google-Smtp-Source: AKy350aqcWle0+igyyi3HRqu5wyuEUqyYYtvZEscC/o4Mi4koYei6wAHHLkY6jau79inBDobunIgDfTjpRSpgGi41I0= X-Received: by 2002:a05:6402:a47:b0:502:3e65:44f7 with SMTP id bt7-20020a0564020a4700b005023e6544f7mr10184739edb.3.1680540623058; Mon, 03 Apr 2023 09:50:23 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Bart Schaefer Date: Mon, 3 Apr 2023 09:50:12 -0700 Message-ID: Subject: Re: ksh compatibility: initial value of $_ To: "Jun. T" Cc: zsh-workers@zsh.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 51622 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 Mon, Apr 3, 2023 at 5:14=E2=80=AFAM Jun. T wrote: > > Both ksh and bash behave this way, but I personally feel that > getting the script name /path/to/foo for both cases is more > natural and useful. It wouldn't be portable across shells, though, and ... > There may be a situation where a script > wants to know the pathname of itself, but for almost always > it would not be necessary to distinguish the above two cases. ... we already have $ZSH_SCRIPT for that if portability is not an issue. > But probably compatibility with other shells would be more > important? Then guessing executable/script name only if > $_ does not exist in environment would be the way to go. This is my feeling as well.