Subject: Re: wtf(6) RE change
To: Lubomir Sedlacik <salo@Xtrmntr.org>
From: Jaromir Dolecek <jdolecek@netbsd.org>
List: tech-userlevel
Date: 02/06/2003 10:20:39
Or use ^, @ or some control character.
Jaromir
Lubomir Sedlacik wrote:
-- Start of PGP signed section.
> 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
> ===================================================================
> 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=`echo $1 | tr '[a-z]' '[A-Z]'`
> ans=`fgrep $target < $acronyms 2>/dev/null \
> - | sed -ne "/^$target[[:space:]]/s/^$target[[:space:]]*//p"`
> + | sed -ne "\|^$target[[:space:]]|s|^$target[[:space:]]*||p"`
> if [ "$ans" != "" ] ; then
> echo "$target: $ans"
> else
>
>
> regards,
>
> --
> -- Lubomir Sedlacik <salo@Xtrmntr.org> --
> -- <salo@silcnet.org> --
-- End of PGP section, PGP failed!
--
Jaromir Dolecek <jdolecek@NetBSD.org> http://www.NetBSD.org/
-=- We should be mindful of the potential goal, but as the tantric -=-
-=- Buddhist masters say, ``You may notice during meditation that you -=-
-=- sometimes levitate or glow. Do not let this distract you.'' -=-