Date: Thu, 7 Dec 2017 02:49:08 +0100 From: Vladimir Botka <vbotka@gmail.com> To: Yuri Pankov <yuripv@gmx.com> Cc: RW <rwmaillists@googlemail.com>, freebsd-questions@freebsd.org Subject: Re: grep problem Message-ID: <20171207024717.15bf2287@planb.netng.org> In-Reply-To: <8277e864-c52a-09a4-dca9-58f83469f5fc@gmx.com> References: <20171207005542.43a7f55f@gumby.homeunix.com> <8277e864-c52a-09a4-dca9-58f83469f5fc@gmx.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--Sig_/aJIED3a+kxShsP33LManyQx Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable > > $ echo 'a-b' | grep '\-b' > > a-b =20 > Looks like it's treated as option -b even inside the single quotes, you=20 > could use '--' to mark the end of options, i.e.: > $ echo 'a-b' | grep -- -b > a-b FWIW. Still the question remains what makes escaped -b a pattern. It'd be necessary to learn about getopt_long which is used to parse the arguments to understand it, I think. https://www.gnu.org/software/libc/manual/html_node/Getopt-Long-Options.html -vlado --Sig_/aJIED3a+kxShsP33LManyQx Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEcBAEBCAAGBQJaKJ4UAAoJEJDRmRKO1E8BGGYH/3H2bHDaReQG264p7WkLAHHr OpZlypEwlQ4ruBLpT5rEv+I8e9phUyJx9SsCSVThY5hfu+WrmM0LS9vd4Q/0qiZo g7rxp+IbTDQn33s3GYKL+kTdHhiKqrOfQTl+BaD2VZskoWVkXyDE4kbNMkgsRnfx t+fTlkL5RLrrJsx5JjMoRg6kqRWI9h0Q+L6tdC1vlY5jQq0sIRsx0fWjZEMeac44 pRbJAkm0Z9XB6JbfxcJrnUFmmhOyI0gK8gYWTHIO0P1/JAzwzqXDMUf/2ya0rcwo iHm8lYhaEtyqMtLNHCCEyZZcwD4rH0U/JM8qNukEqXFZTtywVdEVFvfb60bsswU= =/5XG -----END PGP SIGNATURE----- --Sig_/aJIED3a+kxShsP33LManyQx--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20171207024717.15bf2287>