aptitude, dpkg: Replace some grep+cuts with awk

master
Ville Skyttä 2014-01-06 17:56:36 +02:00
parent e3edf7ac42
commit e777395ac3
2 changed files with 3 additions and 3 deletions

View File

@ -9,7 +9,7 @@ _comp_dpkg_hold_packages()
_comp_dpkg_hold_packages()
{
command grep -B 2 'hold' /var/lib/dpkg/status | \
command grep "Package: $1" | cut -d\ -f2
awk "/Package: $1/ { print \$2 }"
}
}

View File

@ -12,7 +12,7 @@ _comp_dpkg_installed_packages()
command grep -B 1 -Ee "ok installed|half-installed|unpacked| \
half-configured" \
-Ee "^Essential: yes" | \
command grep "Package: $1" 2>/dev/null | cut -d\ -f2
awk "/Package: $1/ { print \$2 }" 2>/dev/null
}
}
@ -28,7 +28,7 @@ _comp_dpkg_purgeable_packages()
command grep -B 1 -Ee "ok installed|half-installed|unpacked| \
half-configured|config-files" \
-Ee "^Essential: yes" | \
command grep "Package: $1" 2>/dev/null | cut -d\ -f2
awk "/Package: $1/ { print \$2 }" 2>/dev/null
}
}