Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 May 2012 19:00:17 GMT
From:      Warren Block <wblock@wonkity.com>
To:        freebsd-doc@FreeBSD.org
Subject:   Re: docs/167932: [PATCH] examples/csh/dot.cshrc SSH_AUTH_SOCK example incorrect
Message-ID:  <201205151900.q4FJ0HxL081061@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR docs/167932; it has been noted by GNATS.

From: Warren Block <wblock@wonkity.com>
To: Guido Falsi <madpilot@freebsd.org>
Cc: FreeBSD-gnats-submit@freebsd.org, freebsd-doc@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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201205151900.q4FJ0HxL081061>