Given a text file file.txt
, transpose its content.网络
You may assume that each row has the same number of columns and each field is separated by the ' '
character.app
Example:ssh
If file.txt
has the following content:阿里云
name age alice 21 ryan 30
Output the following:debug
name alice ryan age 21 30
看例子,其实要作的事情很清楚吧,而后能够用 awk(awk是行处理器: 相比较屏幕处理的优势,在处理庞大文件时不会出现内存溢出或是处理缓慢的问题,一般用来格式化文本信息) ,来看看怎么写,下面这种写法也是我第一次见。code
awk '{ for(i=1; i<=NF; ++i) {if (word[i] == "") {word[i] = $i} else{word[i] = word[i]" "$i}}} END{for(i=1; i<=NF; ++i) {print word[i]}}' file.txtblog
固然中间有个小插曲,由于我想在阿里云的机器上试试,结果总是显示内存
那我用 ssh -v 试试,打印出 debug 信息,毫无进展it
而后就是查看 /etc/hosts.allow 和 /etc/hosts.deny 看里面有没有配置信息,由于你们都说是启用了 TCP Wrapper 访问控制所致awk
可是里面什么信息都没有,放弃了,不是这个问题
而后也说了不少链接数的问题,其实我都知道这个不会是,由于就我本身玩呀,能够用lsof -i:22 看看
什么都没有改变,那到底什么不同吗,我以为只能是网络了,果真用了手机的热点,就能够访问了,可是咱们公司的网络又作了什么事情呢?