Awk中调用shell命令
生活随笔
收集整理的這篇文章主要介紹了
Awk中调用shell命令
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
Awk中調用shell命令
需求 在awk中,有時候需要調用linux系統中命令,如計算字符串的MD5值,并保存下來。
方法參考?call a shell command from inside awk and pass some awk variables to the shell command
cmd=sprintf("md5sum?%s | cut -f2,2", url);#printf("command?%s\n", cmd);cmd | getline sign_str;printf("%s\t%s\n", url, sign_str);close(cmd)
注意close不能省略,否則會影響后一次的計算。
轉載于:https://www.cnblogs.com/westfly/p/4776694.html
總結
以上是生活随笔為你收集整理的Awk中调用shell命令的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 关于tomcat8在windows200
- 下一篇: expdp\impdp及exp\imp