From nobody Tue Feb 03 14:49:07 2026 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 4f55wM4YgLz6Pfcm for ; Tue, 03 Feb 2026 14:49:07 +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 "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4f55wM2f6cz3v4X for ; Tue, 03 Feb 2026 14:49:07 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1770130147; 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; bh=cmmJAvLuGdI1zGn5Lt1JLq9SXfoAUYVhC5U/lzDkZUY=; b=mSaIUTZuG5jwRxisyLt9jctyJtko8NcGCHbyCQzCe6v8gn+br4Dq3kUDUvWHptfYncYJxS W3YLhuH87GHun/rq0xhWidxZSAjPfvwv02O3lby9kutKteBKCFQ1oqe3NEN+qtgF0aU8IU HtcdjxvtoI4iqhGlcMUzseZFuoJy3s1YYbeL9KBOFkucMQ3mLRVopi9HBRgl2b2UShhzio H3dHwroRdzeujEOrjGOnI5ML3G8Ty31LzIasTecICDCCo9xsT2P6LAd3lUCjm2lrCY5SLZ 53Idh1yQAuxJU3oof+ouyWF9a1zSjnhqBciQCgBfXY4PUrCDOX5XQx9QlfIkeQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1770130147; a=rsa-sha256; cv=none; b=o8OP8PYZqd5nSkyZ1BNmQoIC/7zHydSXWnZW6M7vy6G9czVIo6AWsp4vpPhIjIZj6nsqQC P4Vf3hBzPLLGidGzvLfxfXclqhx6SkxdXtFItZcbC1v/qmQXnHrUGo+G0VW6/hQjv7Dfd8 oPlz6l5Fhp9o26MCQ+0oszAGauS38dXqL7sji1p984HJkGhBmQB/hc7BGbJ5RZF+ZfzQTh yfx2Kwy0DnWXQ+0kwbZDn02UzKJhGG0k4VGIQKwI1zYLN9AQ48efSPIWrDxYq2vUnUMhqE zcWfZoe19PxuezOu6m4jtV7EPwSe5IuZ4DqINygWGp7aNtKcA3WG/QFYvnIGFw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1770130147; 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; bh=cmmJAvLuGdI1zGn5Lt1JLq9SXfoAUYVhC5U/lzDkZUY=; b=RCgOgr6g6j+3A66n/I/TEMjLqxmfRQpWQwEvHPOk0HHBNBzlnzQn/f+rS99iBSk9kb1xw5 nrSDty198bhIsQQXRMo9OQdSWOtFM/z6V/6Nd2Xw4f7Z9oP3uk3QZIfk8QKvjGDAUdn3FR KrE5Z5BoPFG7RGG6JYD1GHjEB5JFydCooKyuMQmLqBa7q4yLdXWPn9CDfp/84jStOut5Dt 6NeXFym/LkebXoSvr5fHTbdO/VfpMsa+4GneLA3Aae4V2EPlNO9ym+Z1CnVBAoWBlb4Aoc g33qoSRXSB4KSSPjORWTxfS1CpWp7H3nvXWnJ87SSPngaa260y8yrZA7fWH4bw== 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 4f55wM2GNlz2Bp for ; Tue, 03 Feb 2026 14:49:07 +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 613En7nI027279 for ; Tue, 3 Feb 2026 14:49:07 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 613En75K027278 for bugs@FreeBSD.org; Tue, 3 Feb 2026 14:49:07 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 292912] usr.bin/sed: allow comments after s/// Date: Tue, 03 Feb 2026 14:49:07 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 16.0-CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: devnull@apt322.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" 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 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D292912 Bug ID: 292912 Summary: usr.bin/sed: allow comments after s/// Product: Base System Version: 16.0-CURRENT Hardware: Any OS: Any Status: New Severity: Affects Many People Priority: --- Component: bin Assignee: bugs@FreeBSD.org Reporter: devnull@apt322.org Created attachment 267742 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D267742&action= =3Dedit sed to allow # comments after s/// Hello, According to POSIX SED conformance, it should be possible to use comments (= #) not only on the first line of a SED script, but anywhere at the end flags, = with all text after the comment character (#) being ignored until a new line is encountered. https://pubs.opengroup.org/onlinepubs/9699919799/utilities/sed.html But on FreeBSD, we got an error: # sed -e 's/word/newword/ #comments' test.txt sed: 1: "s/word/newword/ #comments ": bad flag in substitute command: '#' On GNU sed, it works. On man page (https://www.gnu.org/software/sed/manual/sed.html#index-_0023-_0028comments= _0029), we can see: =E2=80=9C3.4=E2=80=A6 be aware that some implementations of sed (which are = not POSIX conforming) may only support a single one-line comment, and then only when = the very first character of the script is a #.=E2=80=9D Therefore, I suggest accepting # as a comment when used after the last flag= s, in accordance with POSIX. Thanks --=20 You are receiving this mail because: You are the assignee for the bug.=