7.Shell
本章同步視頻:https://edu.51cto.com/sd/e4874
7.6.5 字符轉換與連接命令: tr, join, paste
1.tr - translate or delete characters
[dmtsai@study ~]$ tr [-ds] SET1 ...
[root@localhost tmp]# cat tr.file
[root@localhost tmp]# cat tr.file |tr "o" "O"
[root@localhost tmp]# cat tr.file |tr "[a-z]" "[A-Z]"
[root@localhost tmp]# cat tr.file |tr [0-9] [a-j]
google bba fbea #數字0-9用字碼a-j替換
[root@localhost tmp]# cat tr.file |tr -d " "
[root@localhost tmp]# cat tr.file |tr -s [a-zA-Z0-9]
[root@localhost tmp]# cat tr.file |tr -s "\n"
[root@localhost tmp]# cat tr.file |tr " " ":"
google:110:5140 #用:做分隔符,而不再用空格