From owner-freebsd-doc@freebsd.org Sat Feb 24 20:41:04 2018 Return-Path: Delivered-To: freebsd-doc@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFAA0F20685 for ; Sat, 24 Feb 2018 20:41:04 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.ysv.freebsd.org (mxrelay.ysv.freebsd.org [IPv6:2001:1900:2254:206a::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.ysv.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8097975EA7 for ; Sat, 24 Feb 2018 20:41:04 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.ysv.freebsd.org (Postfix) with ESMTPS id CBDF716868 for ; Sat, 24 Feb 2018 20:41:03 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id w1OKf3mO057459 for ; Sat, 24 Feb 2018 20:41:03 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id w1OKf3gj057446 for freebsd-doc@FreeBSD.org; Sat, 24 Feb 2018 20:41:03 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: freebsd-doc@FreeBSD.org Subject: [Bug 226112] awk(1) man page unclear about field separator, FS Date: Sat, 24 Feb 2018 20:41:03 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Documentation X-Bugzilla-Component: Documentation X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: jamie@catflap.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-doc@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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 MIME-Version: 1.0 X-BeenThere: freebsd-doc@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Documentation project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Feb 2018 20:41:05 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D226112 Jamie Landeg-Jones changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jamie@catflap.org --- Comment #2 from Jamie Landeg-Jones --- Hi. Thanks for the reply. I'll explain how I got here: I wanted to do a quick hack to split a line at every character, and at that point, I was not familiar with "awk" allowing a null character to do the jo= b. Hence, believing the strings was a regular expression, I set FS to "." whic= h - contrary to the manual - was taken as a literal, not a RE! Indeed, in your description of the atom from re_format, you missed out: "or a single character with no other significance (matching that character)= ." As in your examples: You used examples where a single character is already a literal character in RE, which isn't always the case: % printf 'hello(world' | egrep '(' egrep: Unmatched ( or \( % printf 'hello(world' | awk -F '(' '{print $1}' hello I know this is hardly a major error, but it is still inaccurate - especiall= y in the case of "."! Just for info, the actual text from gawk (which probably phrases it better = than I did!) is: "If FS is a single character, fields are separated by that character. If F= S is the null string, then each individual character becomes a separate field.=20 Otherwise, FS is expected to be a full regular expression." Cheers, Jamie --=20 You are receiving this mail because: You are the assignee for the bug.=