Subject: Re: wtf(6) RE change
To: Jaromir Dolecek <jdolecek@netbsd.org>
From: Lubomir Sedlacik <salo@Xtrmntr.org>
List: tech-userlevel
Date: 02/06/2003 15:00:01
--QTprm0S8XgL7H0Dt
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Feb 06, 2003 at 10:20:39AM +0100, Jaromir Dolecek wrote:
>
> Or use ^, @ or some control character.

^ would require another \ escaping in RE for "beginning of the line" and
@ is not as readable as | is.  i wanted to keep it as simple and
readable as possible, | looked like an ideal candidate:

 "\^\^$target[[:space:]]^s^\^$target[[:space:]]*^^p"
 "\@^$target[[:space:]]@s@^$target[[:space:]]*@@p"
 "\|^$target[[:space:]]|s|^$target[[:space:]]*||p"

even with it's functionality.  if you use ^ or @ characters while they
are used as a separators, you will get an error:

  > wtf is @=20
  sed: 1: "\@^@[[:space:]]@s@^@[[: ...": invalid command code [
  Gee...  I don't know what @ means...

  > wtf is ^
  sed: 1: "\^\^^[[:space:]]^s^\^^[ ...": invalid command code [
  Gee...  I don't know what ^ means...

while | is always interpreted by the shell first so there is no
confusion:

  > wtf is |
  pipe>=20

are there any objections or can i commit this change?


regards,

--=20
-- Lubomir Sedlacik <salo@Xtrmntr.org>                   --
--                  <salo@silcnet.org>                   --

--QTprm0S8XgL7H0Dt
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (NetBSD)

iD8DBQE+QmphiwjDDlS8cmMRAmgyAJ93OdRzMVM0p6qnigQSPdKhlIuDUgCdHrTR
z/EEF42ZSCiy8fEjSPJ5kRg=
=gzwJ
-----END PGP SIGNATURE-----

--QTprm0S8XgL7H0Dt--