pacmanでパッケージ名のみを完全一致で検索したい。
-Ss
などは説明まで含んでしまうので適切ではない。
そのため-Fq
やgrep
を使用して無理やり検索します。
function searchpkg(){
if pacman -Ssq "${1}" 2>/dev/null | grep -o "^${1}*\$" 1>/dev/null; then
return 0
else
return 1
fi
}
Go to list of users who liked
More than 3 years have passed since last update.
pacmanでパッケージ名のみを完全一致で検索したい。
-Ss
などは説明まで含んでしまうので適切ではない。
そのため-Fq
やgrep
を使用して無理やり検索します。
function searchpkg(){
if pacman -Ssq "${1}" 2>/dev/null | grep -o "^${1}*\$" 1>/dev/null; then
return 0
else
return 1
fi
}
Register as a new user and use Qiita more conveniently
Go to list of users who liked