ssh-agent-restore: FIX: bash 'with any trailing newlines deleted' and wc legitimately not counting last line missing its newline.

This commit is contained in:
Julien Palard 2017-07-27 10:46:53 +02:00
parent 79629b9ef1
commit a24a965958
1 changed files with 1 additions and 2 deletions

View File

@ -3,9 +3,8 @@ ssh-agent-restore()
{
QUIET="$1"
AGENTS="$(ls -1tr /tmp/ssh-*/* 2>/dev/null)"
QTY="$(printf "%s" "$AGENTS" | wc -l)"
if [ z"$QTY" = z"0" -a -z "$QUIET" ]
if [ z"$?" != z"0" -a -z "$QUIET" ]
then
printf "No ssh-agent found.\n" 1>&2
return 1