- 论坛徽章:
- 0
|
bash-2.03# cat f1
梁白垛刊承卿猜罢搏群霍妹督菠课蕉
稗槐骨瘤趁卷猴迁庞绢祈的旗龟荣爆
砰毕肩吹份寇济寄境弄缄根龚蛮缔跺
槐帕免捌稗氨率腊葫蒂凯妹椒欠闹钳
辩惊古鹿理弛零礼咖霉鼻缉况鸽垄久
bash-2.03# awk 'BEGIN{srand()}{b[rand()" "NR]=$0}END{for(x in b)print b[x]}' f1
稗槐骨瘤趁卷猴迁庞绢祈的旗龟荣爆
槐帕免捌稗氨率腊葫蒂凯妹椒欠闹钳
辩惊古鹿理弛零礼咖霉鼻缉况鸽垄久
砰毕肩吹份寇济寄境弄缄根龚蛮缔跺
梁白垛刊承卿猜罢搏群霍妹督菠课蕉
bash-2.03# awk 'BEGIN{srand()}{for(i=1;i<=NF;i++)a[rand(),i]=$i;for(i in a)c=c"
"a[i];sub(/^./,"",c);b[rand(),NR]=c;delete a[i];c=""}END{for(x in b)print b[x]}'
f1
梁白垛刊承卿猜罢搏群霍妹督菠课蕉
槐帕免捌稗氨率腊葫蒂凯妹椒欠闹钳
砰毕肩吹份寇济寄境弄缄根龚蛮缔跺
稗槐骨瘤趁卷猴迁庞绢祈的旗龟荣爆
辩惊古鹿理弛零礼咖霉鼻缉况鸽垄久
bash-2.03# awk 'BEGIN{srand()}{for(i=1;i<=NF;i++)a[rand(),i]=$i;for(i in a){c=c"
"a[i];sub(/^./,"",c);b[rand(),NR]=c;delete a[i]};c=""}END{for(x in b)print b[x]
}' f1
辩惊古鹿理弛零礼咖霉鼻缉况鸽垄久
梁白垛刊承卿猜罢搏群霍妹督菠课蕉
砰毕肩吹份寇济寄境弄缄根龚蛮缔跺
槐帕免捌稗氨率腊葫蒂凯妹椒欠闹钳
稗槐骨瘤趁卷猴迁庞绢祈的旗龟荣爆
bash-2.03# |
|