Computing.Net > Forums > Programming > Shell commnd in awk script

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Shell commnd in awk script

Reply to Message Icon

Name: sujataabi
Date: December 22, 2005 at 12:15:24 Pacific
OS: Solaris 9
CPU/Ram: Ultra 60, 1Gb
Comment:


Please can someone help with following script , I want to pass value of variable w returned by awk script and run shell command within awk.
I want to use , for example "echo w" within awk script, it does display anything but {print w} works fine.
I want to issue netbackup command and want to pass value of w to it.
Thanks

#!/bin/ksh
awk '$NF ~ /FROZEN/ {print $1 " " $NF}' media.list | sed s'/FULL\///g'>>test.data
awk '
/FROZEN/ {count[$1]++}
END {for (w in count)
if(count[w] <= 3) {
# {print w}
# system ("bpmedialist -ev " w " -U")
system("/usr/bin/echo wee")
# "/usr/bin/echo" Hello
}
else
print count[w], w
}' test.data



Sponsored Link
Ads by Google

Response Number 1
Name: sujataabi
Date: December 28, 2005 at 07:06:01 Pacific
Reply:

Can someone help with the awk script above.
Thanks


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Shell commnd in awk script

AWK in bash script www.computing.net/answers/programming/awk-in-bash-script/14878.html

evaluating function/array in awk www.computing.net/answers/programming/evaluating-functionarray-in-awk/17561.html

Shell Script with AWK www.computing.net/answers/programming/shell-script-with-awk/15486.html