Subject: wtf(6) RE change
To: None <tech-userlevel@netbsd.org>
From: Lubomir Sedlacik <salo@Xtrmntr.org>
List: tech-userlevel
Date: 02/06/2003 00:04:35
--pvezYHf7grwyp3Bc
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
hi,
i was thinking about adding acronyms such as W/ and W/O but currently
wtf(6) uses the slash ("/") character as the command delimiter for the
sed RE. since pipe ("|") is not very likely to appear in an acronym and
must be prefixed with a backslash ("\") anyway, i propose to change the
RE to allow the slash ("/") character in acronyms. what about the
following patch?
Index: wtf
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvsroot/src/games/wtf/wtf,v
retrieving revision 1.7
diff -u -r1.7 wtf
--- wtf 2000/11/21 00:18:52 1.7
+++ wtf 2003/02/05 22:53:52
@@ -19,7 +19,7 @@
while [ $# -gt 0 ] ; do
target=3D`echo $1 | tr '[a-z]' '[A-Z]'`
ans=3D`fgrep $target < $acronyms 2>/dev/null \
- | sed -ne "/^$target[[:space:]]/s/^$target[[:space:]]*//p"`
+ | sed -ne "\|^$target[[:space:]]|s|^$target[[:space:]]*||p"`
if [ "$ans" !=3D "" ] ; then
echo "$target: $ans"
else
regards,
--=20
-- Lubomir Sedlacik <salo@Xtrmntr.org> --
-- <salo@silcnet.org> --
--pvezYHf7grwyp3Bc
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (NetBSD)
iD8DBQE+QZiCiwjDDlS8cmMRAuA4AJ9XWng9Oq1mf5pIm1WXmGCa241LxwCeMEO8
UgwP4UIoXWP1Sk4Ls7Ma7SY=
=sHuv
-----END PGP SIGNATURE-----
--pvezYHf7grwyp3Bc--