awk如何get shell指令執行的結果?秘訣就是getline.

 

http://stackoverflow.com/questions/2210078/how-to-use-getline-in-awk-with-a-command-that-is-concatenated-together

 

我的實例:

CMD = "xxd -s "$1" -l 1 -b ./status_file/"sfile

CMD |getline xxd_var  

其中

1.CMD可以用字串去拼湊

2.getline後面接的是你awk裡面使用的變數名稱.

 

getline其實還可以用來操作檔案的讀取.原來的範例網站已經被移除,之後有用到或是有查到再補上.

 

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 stellaforauto 的頭像
    stellaforauto

    狂暴綿羊完勝企鵝教戰手冊

    stellaforauto 發表在 痞客邦 留言(0) 人氣()