[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#742318: apt: version 'amd64' has bad syntax



On Sat, Mar 22, 2014 at 02:26:34PM +0100, Cristian Ionescu-Idbohrn wrote:
> May I suggest a replacement for:
> 
> list="$(${DPKG} -l | awk '/^ii[ ]+(linux|kfreebsd|gnumach)-image-[0-9]/ && $2 !~ /-dbg$/ { print $2 }' | sed -e 's#\(linux\|kfreebsd\|gnumach\)-image-##')"
> 
> Either of these:
> 
> list=$($DPKG -l | sed -rne '/^ii[[:blank:]]+((linux|kfreebsd|gnumach)-image-([0-9][^[:blank:]]+))[[:blank:]].*/{s//\3/;/-dbg$/d;p}')
> list=$($DPKG -l | sed -ne '/^ii[[:blank:]]\+\(\(linux\|kfreebsd\|gnumach\)-image-\([0-9][^[:blank:]]\+\)\)[[:blank:]].*/{s//\3/;/-dbg$/d;p}')
> 
> remove the need of forking `awk'.
> 
They're less readble than the version with sed and fork IMO.

-- 
Julian Andres Klode  - Debian Developer, Ubuntu Member

See http://wiki.debian.org/JulianAndresKlode and http://jak-linux.org/.

Please do not top-post if possible.


Reply to: