grepの-oオプションと-Pオプションの組み合わせが便利

$ paste <(cat score | grep -oP '[^\d]+') <(cat score | grep -oP '\d+') | xargs -n 2 #シェル芸— ぐれ (@grethlen) 2014, 6月 14 上記のようにgrepコマンドを叩いていたら「-oPってオプションなに?」と言われたので。 grep -oPって? -oオプションとは --only-matchingの略。マッチした部分のみを抽出するというオプ…