10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
i run the command
snmptable -v2c -c public myIP IF-MIB::ifTable
the result look like this :
SNMP table: IF-MIB::ifTable
ifIndex ifDescr ifType ifMtu ifSpeed ifPhysAddress ifAdminStatus ifOperStatus
1 Unit: 1 Slot: 0 Port: 1... (7 Replies)
Discussion started by: wanttolearn1
7 Replies
2. Shell Programming and Scripting
im using the code below to monitor a file:
gawk '{
a += gsub("(^| )accepted( |$)", "&")
a += gsub("(^| )open database( |$)", "&")
} END {
for (i in a)
printf("%s=%s\n", i, a)
}' /var/log/syslog
the code is searching the syslog file for the string "accepted" and "open... (2 Replies)
Discussion started by: SkySmart
2 Replies
3. Shell Programming and Scripting
Hi,
The following awk command :
asmcmd lsdg | awk '{print $13;}' | grep -i ${SID}
return the following output . An Empty line + two lines contain "/" at the end of the line
INDEVDATA/
INDEVFRA/
I need to remove the "/" as well as the empty line.
Please advise
Thanks (3 Replies)
Discussion started by: Yoav
3 Replies
4. Shell Programming and Scripting
I have files structured in stanzas, whose title is '', and the rest couples of 'id: value'. I need to find text within the title and return the whole stanzas that match the title.
The following works:
awk 'BEGIN{RS="";IGNORECASE=1}/^\/' myfileI would need to count all of the occurences, though,... (7 Replies)
Discussion started by: hermes14
7 Replies
5. Shell Programming and Scripting
In the following line The AWK statement parses through a listing for files and outputs the results using the {print} command to the screen. Is there a way to (a) send the output to a file and (b) actually perform a cp cmd to copy the listed files to another directory?
ls | awk -va=$a -vb=$b... (1 Reply)
Discussion started by: rdburg
1 Replies
6. Shell Programming and Scripting
Hi all,
I'm new to awk and I'm experiencing syntax error that I don't know how to resolve. Hopefully some experts in this forum can help me out.
I created an awk file that look like this:
$ cat myawk.awk
BEGIN {
VAR1=PATTERN1
VAR2=PATTERN2
}
/VAR1/ { flag=1 }
/VAR2/ { flag=0 }
{... (7 Replies)
Discussion started by: hk18
7 Replies
7. Shell Programming and Scripting
Hey, I'm trying to use awk for some simple file manipulations but i'm getting soem wierd results.
So i want to open up a file which looks like this:
@relation 'autoMpg'
@attribute a numeric
@attribute b numeric
@attribute c numeric
@data
-1.170815,0.257522,0.016416... (2 Replies)
Discussion started by: amatheny
2 Replies
8. Shell Programming and Scripting
I try to get the month (of last save) and the filename into a variable, is this possible ?
something like this :
for month in `ls -la | awk '{print $6}'`
do
if ]
then
a=filename of the matching file
cp $a /Sep
fi
thanks,
Steffen (1 Reply)
Discussion started by: forever_49ers
1 Replies
9. Shell Programming and Scripting
I am awk-ing a line, and only want to get the results of the five chrs. following my field seperator. the line of prose is:
Unit=01982 (PICO RIVERA)
Unit=I1001 (INTERMOUNTAIN AREA)
Unit=E1000 (INTERMOUNTAIN WEST DIVISION)
failing in using an awk of:
awk -F= '/Unit/{print $2 length(5)}'... (3 Replies)
Discussion started by: gozer13
3 Replies
10. UNIX for Dummies Questions & Answers
I am searching some rather large text files using grep and or awk.
What I would like to know is if there is a way (either with grep, awk, or realy any other unix tool) to stop the search when a predifined number of results are returned.
I would like to do this for speed purpuses. When i get... (6 Replies)
Discussion started by: evan108
6 Replies