From owner-freebsd-questions@freebsd.org Thu Dec 7 01:49:19 2017 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 279AAE95B6A for ; Thu, 7 Dec 2017 01:49:19 +0000 (UTC) (envelope-from vbotka@gmail.com) Received: from mail-wr0-x242.google.com (mail-wr0-x242.google.com [IPv6:2a00:1450:400c:c0c::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 39EC16E7B5 for ; Thu, 7 Dec 2017 01:49:16 +0000 (UTC) (envelope-from vbotka@gmail.com) Received: by mail-wr0-x242.google.com with SMTP id x49so5798242wrb.13 for ; Wed, 06 Dec 2017 17:49:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :organization:mime-version; bh=G8nIy6u7iEbBLOb+siEQzg5GUPjNZ2py27+Ve7teziU=; b=OSdBvO9kOKTsMRYlmg1K3u+1/mT79fo0cSzbCsvyf7kKWSed0QgTUy4AI01iPAnno1 n6yYCHOLG6M4EJfT4FR6SAKUKzAxn9kyCv5gUE9g0hQjrCx6ByBDSnezDhyaDzXGRBFM yiaXsJdBwua8SNVKc5wSCDJdBomAfE9tQ2tRvzIPDR7NWy/VPA/QRitPjYUGX3WIuCk7 X//DiA403b9OFmgD213m2o2OHd/LA0B73VDlh56pV7hKJ8a/yNkJagQpATjVchwOw5X2 Ig1b9Yeur3F4iZQrH6hDo/e/WD8HR9XvJlof0+dft/TV8tR7GFFGUeY7v6PPnuPe9wgp R17w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:organization:mime-version; bh=G8nIy6u7iEbBLOb+siEQzg5GUPjNZ2py27+Ve7teziU=; b=fvSn/qzjehI6x20/AQhF0nH95zzNv08npDDbGo4K7Llq8OFf6d/ZiffTJf17gtkHRS p0kWT7KxaEyroEHSIqFhuCt7GwIojvqpHqPIgQNPcE0kEPpOqV38FaI+2tLIVolCvsZV tLBlm4TgsBXO5U4qT2mnuYo1bHenDqWbUChxivdBi6F1IsB2M+fwgUsRoAGoqvwCLfKI oCj7v91KxHhyUYQs4M8ccEKWZABDdTutSeHH1p9JUf+vwKk6VoHu8BmCd3GNTHmtfbwB Me2JPYkLOJQzk6a4E6n/uz6vXazDF5G3OzLRa4KqqCXBpxdC44bhwkT6ueoC+cgJxcXj zHKg== X-Gm-Message-State: AJaThX5wilSehOk5RjIZdSLgNRl6TehqX6PqVr0nLB9Fqrb1J7otkgim bWQHAt/DdbObLVstdB/OUCM= X-Google-Smtp-Source: AGs4zMZHIEQbd6Sotsm59qxF6MS5+VSMqa6AZEGK06cr+vT4OAmgMeGmcUqk1bChld393S1DW7LKXw== X-Received: by 10.223.130.177 with SMTP id 46mr23395156wrc.176.1512611354653; Wed, 06 Dec 2017 17:49:14 -0800 (PST) Received: from planb.netng.org (ip-89-103-146-20.net.upcbroadband.cz. [89.103.146.20]) by smtp.gmail.com with ESMTPSA id r14sm5101857wrb.43.2017.12.06.17.49.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 06 Dec 2017 17:49:13 -0800 (PST) Date: Thu, 7 Dec 2017 02:49:08 +0100 From: Vladimir Botka To: Yuri Pankov Cc: RW , 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> Organization: na X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; i686-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; boundary="Sig_/aJIED3a+kxShsP33LManyQx"; protocol="application/pgp-signature" X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Dec 2017 01:49:19 -0000 --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--