- 论坛徽章:
- 6
|
本帖最后由 1cpuer 于 2018-08-24 20:18 编辑
- # Bash: /home/soio/1bs # 2018-08-24 11:26:41 #1535081201
- # vim A_123
- # Bash: /home/soio/1bs # 2018-08-24 14:37:53 #1535092673
- # awk -vm=3 '{max=0;delete a;for(i=1;i<=length($0);i++)a[substr($0,i,1)]++;for(i in a)if(a>max)max=a}' A_123
- awk: 命令行:1: (FILENAME=A_123 FNR=1) 致命错误: 试图在标量环境中使用数组“a”
- ## for(i in a) #----a[i] 数组..
- # Bash: /home/soio/1bs # 2018-08-24 14:38:14 #1535092694
- # awk '{print substr($0,i,1)}' A_123
- t
- h
- m
- h
- # Bash: /home/soio/1bs # 2018-08-24 14:46:08 #1535093168
- # cat A_123
- thanks1sorryhello57
- hello0347hel
- my2god367
- hello03470000
- m=3 ---- ??
- 每行重复字符 >= 3
- 无法加速
- # Bash: /home/soio/1bs # 2018-08-24 20:05:14 #1535112314
- # awk -vm=3 '{max=0;delete a;for(i=1;i<=length($0);i++)a[substr($0,i,1)]++;for(i in a)if(a[i]>max)max=a[i]}max>=m' A_123
- hello0347hel
- hello03470000
- # very NEW 居然在1个{action} 完成
复制代码
|
|