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.
awk variables in shell script
Name: xoir Date: April 29, 2004 at 09:08:13 Pacific OS: solaris 8 CPU/Ram: ultra 80
Comment:
Hi, Im trying to set variables in awk script but does not work, I dont know what Im doint wrong, this is my script.
#!/bin/sh snmp-cpu="`snmpwalk -v 1 -c public -Oqv 10.10.1.1 1.3.6.1.4.1.9.2.1.58.0`" snmp-tempin="`snmpwalk -v 1 -c public -Oqv 10.10.1.1 1.3.6.1.4.1.9.9.13.1.3.1.3.1`" snmp-tempout="`snmpwalk -v 1 -c public -Oqv 10.10.1.1 1.3.6.1.4.1.9.9.13.1.3.1.3.2`"
Name: Wolfbone Date: April 29, 2004 at 12:11:59 Pacific
Reply:
Avoid using '-' characters in your variable names and don't put {} around OFS="," - it's probably better to put OFS="," in the BEGIN {} statement anyway.
0
Response Number 2
Name: xoir Date: April 29, 2004 at 12:44:06 Pacific
Summary: Hi i've been trying to write shell script with awk that I want to search a substring with variable of shell script In old one ,I wrote awk that find 'xxx' in myfile : #!/bin/ksh awk '/xxx/' myfile...
Summary: Shell Scripting -- Variables In the main script i have exported the variable and accessing it in another file but when i echo the value the value of the exported variable is not viewable . below are ...
Summary: Thank you so much for the help. I would like to know what is the purpose of ~, :space: in the awk command. I really appreciate if you could give me brief description of each line with in the awk comm...