|
发表于 2007-1-1 20:44:21
|
显示全部楼层
好像只有2楼的可以工作正常
我测试了一下,有什么不对的地方,请指正
[root@localhost ~]# cat testfile
1 xorg-x11-font-utils-6.8.2-1.EL.13.37.i386.rpm sdfslf
2 xorg-x11-sdk-6.8.2-1.EL.13.37.i386.rpm dsfsf dfsf
3 xorg-x11-tools-6.8.2-1.EL.13.37.i386.rpm
4 xorg-x11-twm-6.8.2-1.EL.13.37.i386.rpm
5 xorg-x11-xauth-6.8.2-1.EL.13.37.i386.rpm
[root@localhost ~]# cut -d" " -f2- testfile
xorg-x11-font-utils-6.8.2-1.EL.13.37.i386.rpm sdfslf
xorg-x11-sdk-6.8.2-1.EL.13.37.i386.rpm dsfsf dfsf
xorg-x11-tools-6.8.2-1.EL.13.37.i386.rpm
xorg-x11-twm-6.8.2-1.EL.13.37.i386.rpm
xorg-x11-xauth-6.8.2-1.EL.13.37.i386.rpm
[root@localhost ~]# sed 's/.* \{1\}//' testfile
sdfslf
dfsf
xorg-x11-tools-6.8.2-1.EL.13.37.i386.rpm
xorg-x11-twm-6.8.2-1.EL.13.37.i386.rpm
xorg-x11-xauth-6.8.2-1.EL.13.37.i386.rpm
[root@localhost ~]# awk '{for (i=2;i<=NF;i++) {printf $i}printf "\n"}' testfile
xorg-x11-font-utils-6.8.2-1.EL.13.37.i386.rpmsdfslf
xorg-x11-sdk-6.8.2-1.EL.13.37.i386.rpmdsfsfdfsf
xorg-x11-tools-6.8.2-1.EL.13.37.i386.rpm
xorg-x11-twm-6.8.2-1.EL.13.37.i386.rpm
xorg-x11-xauth-6.8.2-1.EL.13.37.i386.rpm |
|