docs/167932: [PATCH] examples/csh/dot.cshrc SSH_AUTH_SOCK example incorrect

Warren Block wblock at wonkity.com
Tue May 15 19:00:17 UTC 2012


The following reply was made to PR docs/167932; it has been noted by GNATS.

From: Warren Block <wblock at wonkity.com>
To: Guido Falsi <madpilot at freebsd.org>
Cc: FreeBSD-gnats-submit at freebsd.org, freebsd-doc at freebsd.org
Subject: Re: docs/167932: [PATCH] examples/csh/dot.cshrc SSH_AUTH_SOCK example
 incorrect
Date: Tue, 15 May 2012 12:50:26 -0600 (MDT)

 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.



More information about the freebsd-doc mailing list