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
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
Summary: There are several ways to embed shell variables in awk scripts and to pass shell variables to awk scripts. Take a look at this link: http://www.tek-tips.com/faqs.cfm?fi... ...
Summary: I am trying to parse a file which has names of some function written in awk. These are user defined function, I have defined these functions in awk script. I want to do the following: whenever a refer...