bash - using shell in awk snippet -
i have problem shell , awk while using them nested. have shell script code prints processes file want read them awk , when find process special condition (for ex: process' start hour 10:00) want copy file. couldn't make it. here code:
#!/bin/sh processes=` ps aux > processes.txt ` awk 'begin {fs = " ";} { if (some statement) { temp = $0 // want copy line file " temp >> anotherfile.txt " // here want use "temp" shell veriable couldn't } } end {}' processes.txt
can show me hint maybe can figure out something. thanks.
ps aux | awk '$9=="10:00"' >>anotherfile.txt
Comments
Post a Comment