From nobody Mon Feb 28 07:31:24 2022 X-Original-To: standards@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 2E55819DD181 for ; Mon, 28 Feb 2022 07:31:25 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4K6XB46bgRz4cdc for ; Mon, 28 Feb 2022 07:31:24 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9081F173B7 for ; Mon, 28 Feb 2022 07:31:24 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 21S7VOGa098240 for ; Mon, 28 Feb 2022 07:31:24 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 21S7VOJG098239 for standards@FreeBSD.org; Mon, 28 Feb 2022 07:31:24 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: standards@FreeBSD.org Subject: [Bug 46441] sh(1): Does not support PS1, PS2, PS4 parameter expansion Date: Mon, 28 Feb 2022 07:31:24 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: feature, needs-patch, needs-qa, standards X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: contact@nathanielbarragan.xyz X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? maintainer-feedback? mfc-stable13? mfc-stable12? X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Standards compliance List-Archive: https://lists.freebsd.org/archives/freebsd-standards List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-standards@freebsd.org X-BeenThere: freebsd-standards@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646033485; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uLMNqw1RL2PWqpBEXgp/GEH4RWNqUeIAEruusn5gn9A=; b=entZzOuDryCNWD4effljsj/ayGAphLkcKwa1cKk17Fg8qKcDr1rFWAqV+fL0N69dmpMakL s2dAQ1KgMr3GOR420BlVXH17xT8s07j2VQx3R7rd3rQUG1DcjheR5bixmp8G5O+7/BqvM0 6fOxeNi2GOMp/6u8OmGdYaZpTFn18QyywfI19HPf7V1AsoWLVZ/tfS8mksCEsGxdW2sI48 wZne2/qY+h2DPfdOYLeGlFTnSDy4uO6vYJZAvV14nH8m0j7i9tZzHP9wOOOqn7yNMfzUxL +AwcScNkBYt0JQgU31O9Ir3EAthlMlszOvshWWKyitWUFIUPD0Olu7W0pFjQvA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1646033485; a=rsa-sha256; cv=none; b=kHo7ROLwZT/twWPM8NkFwZSlu1InPUZvE6gG+HmWC5foCO7VonFfFHJMmEa3+EHUnsNCew AjwdBoWBtBKOyvLC3cjXrItN2N6VmQ/NiPw1KVoVDmPe9ZFxIq/tlrZLF4/bZMcEKPKmds wyX1jAd3coITT7xi8k6QSbgbCKx8Pobp/wFLtmXhbhawjQcITvs6b7VsS/HKrzTNNJRId9 VCmoN0qAFBOaHy6gu7Jg6H5VKGvZcmex7QobfNTk/Jkv98nA/k+GKAE9tZ7EkXjhR2mB3W IXbdj7uFJNiXhfM25uiqg/y4FoVDt1IJGYKx9A/lEPUNDUoh+mbU+y4Gu/cFAQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D46441 --- Comment #11 from Nathaniel Barragan --- I took a look at the code super fast (not planning on any changes yet), and= it seems that command substitution was not added on $PS1/PS2 because the parser relies on PS1 and PS2 not doing command substitution on those variables. Fr= om what it seems, the parser would need to be redone to become re-entrant. Thi= s is because it has some state stored in static global variables, which are clea= red each parse. A possible solution, and one that frankly doesn't sound fun would be to fig= ure out which variables are the ones that hold state local to parsing, and which are really required to be static and global, and move these state-keeping variables to a structure, then pass that structure to each parsing function. --=20 You are receiving this mail because: You are on the CC list for the bug.=