From nobody Mon Feb 28 07:31:24 2022 X-Original-To: bugs@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 C64B019DCECC for ; Mon, 28 Feb 2022 07:31:24 +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 4K6XB431B0z4cj5 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 4766F1742C 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 21S7VOET098224 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 21S7VOrW098223 for bugs@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: bugs@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: AssignedTo 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: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646033484; 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=3fPn2QZbuKzbRhoVT+5LHf3zKg4a+2WM4v7MxA5MTqc=; b=aFdoxk1UsDSvDh/Px1k7frMx47oxfhYdsXmQv/SVaFD2qeqvNlbq7sRe5Wtq8Zov4IjBvx BXsPkGzFZ1LkYLekfwQBITGQpyzVuSH0UTleS9BlWkzvhJapcrZLrl2ancASmKo4zkV246 8PhpMDJVqS1afE3TucSAbfSykpSaANZqI0N0P8rzOKR7aenKnFhzdr3CcBMnutsY72UoHP c6ZJ7Awe/Ox5RrwzJ7/4Li/IycMGq05qp3zwrjHCd8pzdLlgmi5s/tUFmya8LswHZlTFxv eN7DIisyKLRQLxN46mP2uCyjPKrmWLomWNKX0z9Pe4KV7ZMWwBA9c2BFomgAiA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1646033484; a=rsa-sha256; cv=none; b=ny3Y5s17dz/nNW1SFsuKVOCPUswtdI8d+Ne/thVGwawjnNBD6Xvnz0cUJu2mTNSkjoFSKz VKfYWB+IkBgk5og5ip5EwbcHsrgQAjnmno3zZnPO01b6TpzcVx65m5uHCttv6SPvyuGcoP FIqef7F1jlxM2FLfVA6XvA6pmCiVdrrpYF99Fgp7WqDQYBOn2/Az+8fG6XphEMYFX7DaNa FlYGsuvjsjHxYNg6UJ1mKqgBSB8/9BQa7aVl+jCCbWe1cggIl3lXeWsfz1ofUDSyHyWjpj g9OMxRi2nImDInz4XM8ae2WTgi4S20gnu1/PoGZk/hXQ4Wra6IK8G0HzsQqiRA== 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 the assignee for the bug.=