From owner-freebsd-doc@FreeBSD.ORG Tue May 15 18:50:33 2012 Return-Path: Delivered-To: freebsd-doc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09B72106566C; Tue, 15 May 2012 18:50:33 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (wonkity.com [67.158.26.137]) by mx1.freebsd.org (Postfix) with ESMTP id B9C3D8FC15; Tue, 15 May 2012 18:50:32 +0000 (UTC) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.14.5/8.14.5) with ESMTP id q4FIoQXe047434; Tue, 15 May 2012 12:50:26 -0600 (MDT) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.14.5/8.14.5/Submit) with ESMTP id q4FIoQ71047431; Tue, 15 May 2012 12:50:26 -0600 (MDT) (envelope-from wblock@wonkity.com) Date: Tue, 15 May 2012 12:50:26 -0600 (MDT) From: Warren Block To: Guido Falsi In-Reply-To: <3VsPD05sWNz2Yb@megatron.madpilot.net> Message-ID: References: <3VsPD05sWNz2Yb@megatron.madpilot.net> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (wonkity.com [127.0.0.1]); Tue, 15 May 2012 12:50:26 -0600 (MDT) Cc: freebsd-doc@freebsd.org, FreeBSD-gnats-submit@freebsd.org Subject: Re: docs/167932: [PATCH] examples/csh/dot.cshrc SSH_AUTH_SOCK example incorrect X-BeenThere: freebsd-doc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Documentation project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 May 2012 18:50:33 -0000 On Tue, 15 May 2012, Guido Falsi wrote: > It is my personal opinion that sample code should be as correctly > working as possible. > > The simpliest and most legible (used in the attached patch): > > setenv SSH_AUTH_SOCK `sockstat | grep "${USER}" | grep ssh-agent | awk '{ print $6 }'` awk can do a little more to eliminate the second grep: setenv SSH_AUTH_SOCK `sockstat | grep "^${USER} " | awk '/ssh-agent/ { print $6 }'` The anchor before and space after the username in the grep are to make it an exact match and not a subset ("jsm" versus "jsmith"). Although I don't know what sockstat does with a username longer than eight characters. > I know this is a minor glitch, but I thought it was worth reporting > anyway. It is. Accuracy and precision are the goal.