LoginSignup
2
2

More than 5 years have passed since last update.

man postsuper に記載されているmailq削除のawkをperlに変えてみた

Posted at

man postsuper に記載されているmailq削除のawkをperlに変えてみた。

# mailq | tail -n +2 | grep -v '^ *(' | \
      awk 'BEGIN { RS = "" } { if ($8 == "user@example.com" && $9 == "") print $1 }' \
      | tr -d '*!' | postsuper -d -
# mailq | sed '1d' | grep -v '^ *(' | \
      perl -00ane 'print "$F[0]\n" if $F[7]=~q/@example.com$/ && $#F<8' | \
      tr -d '*!' | postsuper -d -
  • 個人的な好みでtailはsedに変更。
  • sedもgrepもtrも消したかったけど自分には無理だった。
  • awkの$9は、recipient2。
2
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
2
2