- 论坛徽章:
- 0
|
原帖由 waker 于 2006-7-31 17:51 发表
[code] awk 'BEGIN{srand()}{for(i=1;i<=NF;i++)a[rand(),i]=$i;for(i in a)c=c" "a;sub(/^./,"",c);b[rand(),NR]=c;delete a;c=""}END{for(x in b)print b[x]}' urfile
[/ ...
人笨了一点,但一定会好好学习,多谢老大指点,但运行结果是这样的:
awk: Syntax error
at line 1 of program << BEGIN{srand()}{for(i ... >>
context is
BEGIN{srand()}{for(i=1;i<=NF;i++)a[rand(),i]=$i;for(i in a)c=c" "a;su
b(/^./,"",c);b[rand(),NR]=c;delete >>> a; <<<
awk: illegal statement
at line 1 of program << BEGIN{srand()}{for(i ... >>
环境是sco5.0.5 ksh |
|