Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Jan 2009 13:33:45 +0100
From:      Christoph Mallon <christoph.mallon@gmx.de>
To:        Oliver Fromme <olli@lurza.secnetix.de>
Cc:        freebsd-hackers@FreeBSD.ORG, xistence@0x58.com, cperciva@FreeBSD.ORG
Subject:   Re: freebsd-update's install_verify routine excessive stating
Message-ID:  <497867A9.7000801@gmx.de>
In-Reply-To: <200901221217.n0MCHfY3086653@lurza.secnetix.de>
References:  <200901221217.n0MCHfY3086653@lurza.secnetix.de>

next in thread | previous in thread | raw e-mail | index | archive | help
Oliver Fromme schrieb:
>  >              cut -f 2,7 -d '|' |
>  >              grep -E '^f' |
>  >              cut -f 2 -d '|' |
>  >              sort -u > filelist
> 
> It's unclear why there are two "cut" commands.  The 7th
> field isn't used at all.  Also, the -E option to grep

After the first cut the seventh field becomes the second:
echo 'a|b|c|d|e|f|g' | cut -f 2,7 -d '|'
So the second cut selects the original seventh field and fills it into 
the file "filelist".

> 
> So I would suggest to replace the whole pipe with this:
> 
>    awk -F "|" '$2 ~ /^f/ {print $2}' "$@" |
>    sort -u > filelist

It should print $7, see above.


	Christoph



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