From owner-freebsd-questions@freebsd.org Thu Dec 7 00:55:47 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 517A3E92B2F for ; Thu, 7 Dec 2017 00:55:47 +0000 (UTC) (envelope-from rwmaillists@googlemail.com) Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::244]) (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 DA5CE6B9D7 for ; Thu, 7 Dec 2017 00:55:46 +0000 (UTC) (envelope-from rwmaillists@googlemail.com) Received: by mail-wm0-x244.google.com with SMTP id 64so10103468wme.3 for ; Wed, 06 Dec 2017 16:55:46 -0800 (PST) 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:subject:message-id:mime-version :content-transfer-encoding; bh=8OQR6gbVYms5kj6Ho3j5SHNHkX+IcH8McHqpKGQ4bmM=; b=eZKqxffMm10tOqek8oQFJrJYGx4z6ojemi9XWMhydsdMa1Brk5O33nvPE5rES9vGLz +/25exk+Skghb+6Kh+zANfa2nl0F7NnGUfxmHJQz1LE6SAulKQn0Gd/gbzQJSPup3pTs B8H6nXsyTAb9eyX1o3YyRu6ZIp0E8IjBPp9YzahKW/qbWjZoQ2/VEnQEsor6C5PsrQBy PUdijUrjNPFkJiqAfQG5nbCik0iyMOhaf/gfXvbkyYOp8jKy28XSrY8T+P3sw4DyMQsj PmnCjXjAzMNR9F4lutruQiaMCn4YMEAC9/Z+f9AosQsCuy2D2T/c+BLAbkf3yG/oWDgW bVQg== X-Gm-Message-State: AJaThX7GRP4bufEfKYzJI43mZdmW3dsfw6Cuik8gSTBR73KxXOTS1oMO 2kulRk89gYQt0aKzmXdrSlJ9rQ== X-Google-Smtp-Source: AGs4zMarxKS6NoHOuxirl8rtTifrWoNxh6mVgBfKW0SVONzrtvIeuxTeQKYATA1r+RgPjh7jzVdYIw== X-Received: by 10.80.217.6 with SMTP id t6mr34467549edj.217.1512608145235; Wed, 06 Dec 2017 16:55:45 -0800 (PST) Received: from gumby.homeunix.com ([81.17.24.158]) by smtp.gmail.com with ESMTPSA id e25sm1765035edc.64.2017.12.06.16.55.44 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 06 Dec 2017 16:55:44 -0800 (PST) Date: Thu, 7 Dec 2017 00:55:42 +0000 From: RW To: freebsd-questions@freebsd.org Subject: grep problem Message-ID: <20171207005542.43a7f55f@gumby.homeunix.com> X-Mailer: Claws Mail 3.15.1 (GTK+ 2.24.31; amd64-portbld-freebsd11.1) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 00:55:47 -0000 Can anyone explain why '-' needs escaping in the following. What special meaning does it have outside of []? $ echo 'a-b' | grep 'a-b' a-b $ echo 'a-b' | grep '-b' Usage: grep [OPTION]... PATTERN [FILE]... Try `grep --help' for more information. $ echo 'a-b' | grep '\-b' a-b