4
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

pacmanでパッケージをワイルドカードで抜き出す方法もどき

4
Last updated at Posted at 2015-02-11

なによこれ?

pacmanからインストール済みパッケージを検索して、pacman -Rnsで一括削除できるように変形する。

なんでまた。

  1. Archで間違えて大量のパッケージ群をインストールしちゃった。
  2. pacmanでワイルドカードって使えたっけ→×
  3. ゴリゴリした。

やったこと

pacman -Qs ros-indigo* | awk 'match($0, /ros-indigo/) {print substr($0, RSTART)}' | awk '{print ($1)}' | awk -F\n -v ORS=' ' '{print}'

これで、削除対象のパッケージが空白区切りで取り出せるはず(awkあんまり使ったこと無いから凄まじく汚い…)

もっといい方法あったら教えていただけると喜びます。

4
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?