Search Results

Search: Posts Made By: slashbash
1,962
Posted By slashbash
hey thanks Skrynesaver
hey thanks Skrynesaver
1,962
Posted By slashbash
Help with egrep command
cat /tmp/inventory.csv|grep AARP|egrep -v "T11|12.4\(7\)"

how do i exclude in addition to above 12.4\(3\)

I have tried adding this in i.e

-v "T11|12.4\(7\)|12.4\(3\)"

but it did not work
1,079
Posted By slashbash
Compare last 90 logs and print repeating lines with >20
*log files are in date order

sample logs...

ciscoresets_20120314
ciscoresets_20120313
ciscoresets_20120312
ciscoresets_20120311
ciscoresets_20120310

cat ciscoresets_20120314...
1,474
Posted By slashbash
great it works, I was missing the {} ...
great it works, I was missing the

{}

---------- Post updated at 08:56 PM ---------- Previous update was at 08:55 PM ----------

any chance you could answer my other post
...
1,474
Posted By slashbash
Help with for/if/else print statements
{for(i in b){if(b[i]-1&&a[i]!=b[i]){print i";\t\t"b[i]}else{print "NEW:"i";\t\t"b[i]} } }

what I need is to just print

else{print "NEW:"i";\t\t"b[i]

and not print

{print i";\t\t"b[i]}
...
1,122
Posted By slashbash
NEW: NEPGRE01,10,13 1 NEW: NEPGRE01,10,14 1...
NEW: NEPGRE01,10,13 1
NEW: NEPGRE01,10,14 1
NEW: NEPGRE01,10,15 1
NEW: NEPGRE01,10,16 1
NEW: SYDGRE04,10,1 1
NEW: SYDGRE04,10,2 1
NEW: SYDGRE04,10,3 1
NEW: SYDGRE04,10,4 1...
1,122
Posted By slashbash
compare & print lines with 2 requirements
1.compare 90 logs >20 print off with correct figure
2.compare latest log i.e ciscoresets_20120314 against all records not just the 90 (as above) and any lines not matching print as:
...
7,292
Posted By slashbash
I have, I used grep -l "string" and it confirms...
I have, I used grep -l "string" and it confirms which files the string comes from.

If I run my first script..

---------- Post updated at 04:56 AM ---------- Previous update was at 04:39 AM...
7,292
Posted By slashbash
the ls lists the files perfectly in date order. ...
the ls lists the files perfectly in date order.

I have tried an underscore ciscostats_* with the same result
7,292
Posted By slashbash
[V490]#files=`ls ciscostats* | sort -t_ -k2.5r...
[V490]#files=`ls ciscostats* | sort -t_ -k2.5r -k2.3,2.4r -k2.1,2.2r`
{c[$1","$2","$3]++}
END{for(i in a)if(b[i]>0&&a[i]+b[i]>=MATCH){print i";\t\t"a[i]+b[i]}else if(c[i]+0==0)print...
7,292
Posted By slashbash
nawk -F, 'NR==FNR{a[$1OFS$2OFS$3]++;next}...
nawk -F, 'NR==FNR{a[$1OFS$2OFS$3]++;next} a[$1OFS$2OFS$3]{b[$1OFS$2OFS$3]++}
END{for(i in b){if(b[i]-1&&a[i]!=b[i]){print i";\t\t"b[i]}else{print "NEW:"i";\t\t"b[i]} } }' OFS=, ciscostats_10032012...
7,292
Posted By slashbash
no. I am getting all new lines printed off...
no.

I am getting all new lines printed off as 1, some these could be more then 1 for example 2+ and still be new, plus in code we are not comparing against all records for new lines to be printed...
7,292
Posted By slashbash
yes and no. 8 of the 10 were >20 ...
yes and no.

8 of the 10 were >20

however

2 out of the 10 were <20 but were genuinely new

so it looks like it's printing everything off as new.

also comparing against the initial code...
7,292
Posted By slashbash
im just getting the new output with that code, no...
im just getting the new output with that code, no >20
7,292
Posted By slashbash
Thanks Chubler but I still need it to compare...
Thanks Chubler but I still need it to compare against all other files and any lines not matching it prints as new, see my second point.
7,292
Posted By slashbash
thanks for your help but it will not be possible...
thanks for your help but it will not be possible for me to do this as I do not have control of the cron.
7,292
Posted By slashbash
Solaris 8 yes # date -d date:...
Solaris 8

yes


# date -d
date: illegal option -- d
usage: date [-u] mmddHHMM[[cc]yy][.SS]
date [-u] [+format]
date -a [-]sss[.fff]
7,292
Posted By slashbash
ok, the cron produces the files with the latest...
ok, the cron produces the files with the latest date stamp i.e

ciscostats_11032012
ciscostats_10032012
ciscostats_09032012

can i ask awk to compare i.e

ciscostats_11032012;...
7,292
Posted By slashbash
above script is the input ...
above script is the input

NEW:NREE_CISCO3750,10,2 2
NEW:NPGG_CISCO3750,10,4 1
AREE_CISCO3750,11,7 62
HHGE_CISCO3750,18,7 11
IIUE_CISCO3750,20,2 27
MRTAN_CISCO3750,17,4 84
7,292
Posted By slashbash
awk script (complex)
picked this up from another thread.


echo 1st_file.csv; nawk -F, 'NR==FNR{a[$1OFS$2OFS$3]++;next} a[$1OFS$2OFS$3]{b[$1OFS$2OFS$3]++}
END{for(i in b){if(b[i]-1&&a[i]!=b[i]){print...
721
Posted By slashbash
fao ahamed help with script
picked this up from another thread.

echo 1st_file.csv; nawk -F, 'NR==FNR{a[$1OFS$2OFS$3]++;next} a[$1OFS$2OFS$3]{b[$1OFS$2OFS$3]++}
END{for(i in b){if(b[i]-1&&a[i]!=b[i]){print...
2,063
Posted By slashbash
as standard user # which gew no gew in...
as standard user

# which gew
no gew in /opt/xdf/bin /opt/xdf-4.3.2/bin /bin /opt/tools /opt/tools/swdl/swdl-1.7.6p1/bin /usr/sbin /usr/local/bin /usr/local/sbin /opt/rsync-2.6.2/bin
2,063
Posted By slashbash
no, there is a lot more involved to checking the...
no, there is a lot more involved to checking the trafic i.e if I was to do this manually I would first have to use ssh and then telnet, so I know the above is wrong
2,063
Posted By slashbash
trying to view contents of an existing script
root#pwd
/opt/tools

root# cat check_traffic
/opt/tools/utils/commands $1 /opt/tools/utils/DIR/check_traffic

root# cat /opt/tools/utils/DIR/check_traffic
gew "check_traffic -v"

Hi above...
1,957
Posted By slashbash
ok thanks. few q's how does %s & $ip...
ok thanks.

few q's

how does %s & $ip know that ip_list entry should be output here? what's the correlation sorry if that sounds dumb.

also

tail -2 is second to last line
with | head -1...
Showing results 1 to 25 of 32

 
All times are GMT -4. The time now is 09:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy