Shell:实现类UltraEdit的列式编辑的功能
UE(UltraEdit)是一个很好的无格式文本编辑工具。其中,最点赞的功能就是列式编辑。
具体如图所示:
在Linux中,也可以通过命令,来实现类似的功能。
具体如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
[root@rhel510 ~]# cat /etc/redhat-release Red Hat Enterprise Linux Server release 5.10 (Tikanga) [root@rhel510 ~]# [root@rhel510 ~]# cat /etc/redhat-release | sed 's/[[:space:]]/\n/g' Red Hat Enterprise Linux Server release 5.10 (Tikanga) [root@rhel510 ~]# [root@rhel510 ~]# cat /etc/redhat-release | sed 's/[[:space:]]/\n/g' | awk -v FS="" '{print $1}' R H E L S r 5 ( [root@rhel510 ~]# [root@rhel510 ~]# cat /etc/redhat-release | sed 's/[[:space:]]/\n/g' | awk -v FS="" '{print $1}' | awk '{ for (i=1;i<=NF;i++) printf $i}END{printf "\n"}' RHELSr5( [root@rhel510 ~]# |
——————————————————
Done.