这段代码:
perl -pe 's/^(\D\w+ \w+)( word )/\1;word/gi'
Run Code Online (Sandbox Code Playgroud)
当输入包含带有重音或特殊字符的单词时,此命令将不起作用: a?, ?.
规定:
我有这段代码可以统计唯一的艺术家文件。
find /PATH/ -type f -exec basename "{}" + 2>/dev/null |
perl -pe 's/ - .*//g' | LC_ALL=C sort -f | uniq -c -i|
gsed -e 's/$/;/'|
awk '{numero=$1;$1=""}{print $0,numero}'|
perl -pe 's/^(\D\w+ \w+)( & )/\1;&/g' |
perl -pe 's/^(\D\w+ \w+ \w+)( & >)/\1;&/g' |
perl -pe 's/^(\D\w+ \w+ \w+ \w+)( & )/\1;&/g' |
perl -pe >'s/^(\D\w+ \w+ \w+ \w+ \w+)( & )/\1;&/g' |
perl -pe 's/^(\D\w+ \w+)( Con …Run Code Online (Sandbox Code Playgroud)