03-11-2008
solved.
kstat bnx | grep ifspeed | awk '{print $1":"$2}'
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
suppose u have a file
P2122 AAJJSKKSKSLSKSKMSKMS
P2123 AASSJMWJNSJNWHNSKSJ
P2126 AHJMKNSAJNSKAKMOKALM
P3533 KKKSJMAKKLLMLMSLMSPM
P2122 JKKSKKMKKSKKKS--------------NSNJ
P2123 NSJN---------MSKMKMKKSLLNSLL
P2126 JNJSJNWKMSK-------------SKKSMK
P3533 JSNSNPWLLL-SKK----SKKKSKKS
so the... (2 Replies)
Discussion started by: cdfd123
2 Replies
2. UNIX for Dummies Questions & Answers
Hi everyone,
$ more abcdefg.ksh
abcdef
alpha beta gamma
abcdef
abcdef
lmnop
$ wc sachin1.ksh
5 7 132 abcdefg.ksh
if you see it shows that file has got 240 characters. I actually want to count how many characters... (1 Reply)
Discussion started by: sachin.gangadha
1 Replies
3. Shell Programming and Scripting
Hi Everyone!
I want to build sql inserts from a list of countries/regions saved in a file. The list looks like this:
United Kingdom
Czech Republic
...
The script I run is:
while read i;
do
var=`expr $var + 1`;
echo "INSERT INTO calltypes VALUES($var, '$i','$i');" >>... (5 Replies)
Discussion started by: linuca
5 Replies
4. Shell Programming and Scripting
Input:
Youcaneasilydothisbyhighlightingyourcode.
Putting space after three characters.
You can eas ily dot his byh igh lig hti ngy our cod e.
How can i do this using sed? (10 Replies)
Discussion started by: cola
10 Replies
5. Shell Programming and Scripting
i have a file which contains alphanumeric data in every line. what i need is the data after certain pattern. the data after the pattern is not of fixed length so i need the data till the space after the pattern.
Input file:
bfdkasfbdfg khffkf lkdhfhdf pattern (datarequired data not required)... (2 Replies)
Discussion started by: gpk_newbie
2 Replies
6. Shell Programming and Scripting
Hello All,
I have a variable which is having values like this..
$var=A,B,C,D,E,F,G,H
I want to add space after every three alphabets so that my final variable should look like this..
$var=A,B,C, D,E,F, G,H
the space should come after the comma of third alphabet..
Pls tell me... (3 Replies)
Discussion started by: smarty86
3 Replies
7. UNIX for Advanced & Expert Users
I created a awk state to calculate the number of success however when the query runs it has a leading zero. Any ideas on how to remove the leading zero from the calculation?
Here is my query:
cat myfile.log | grep | awk '{print $2,$3,$7,$11,$15,$19,$23,$27,$31,$35($19/$15*100)}'
02:00:00... (1 Reply)
Discussion started by: bizomb
1 Replies
8. Shell Programming and Scripting
Thank you for 4 looking this post.
We have a tab delimited file where we are facing problem in a lot of funny character. I have tried using awk but failed that is not working.
In the 5th field ID which is supposed to be a integer only of that file, we are getting corrupted data as below.
I... (12 Replies)
Discussion started by: Srithar
12 Replies
9. UNIX for Beginners Questions & Answers
tr -cd '\11\12\15\40-\176' < file-with-binary-chars > clean-file
This removes special characters but how can I replace it with space (4 Replies)
Discussion started by: eskay
4 Replies
10. Shell Programming and Scripting
here's what im trying to do.
i have a file containing lines similar to this:
data.txt:
1hsRmRsbHRiSFZNTTA1dlEyMWFkbU5wUW5CSlIyeDFTVU5SYjJOSFRuWmpia0ZuWXpKV2FHTnRU
1lKUnpWMldrZFZaMG95V25oYQpSelEyWTBka2QyRklhSHBrUjA1b1kwUkJkd3BOVXpWM1lVaG5k... (5 Replies)
Discussion started by: SkySmart
5 Replies
LEARN ABOUT OPENSOLARIS
kstat_chain_update
kstat_chain_update(3KSTAT) Kernel Statistics Library Functions kstat_chain_update(3KSTAT)
NAME
kstat_chain_update - update the kstat header chain
SYNOPSIS
cc [ flag... ] file... -lkstat [ library...]
#include <kstat.h>
kid_t kstat_chain_update(kstat_ctl_t *kc);
DESCRIPTION
The kstat_chain_update() function brings the user's kstat header chain in sync with that of the kernel. The kstat chain is a linked list of
kstat headers (kstat_t's) pointed to by kc->kc_chain, which is initialized by kstat_open(3KSTAT). This chain constitutes a list of all
kstats currently in the system.
During normal operation, the kernel creates new kstats and delete old ones as various device instances are added and removed, thereby caus-
ing the user's copy of the kstat chain to become out of date. The kstat_chain_update() function detects this condition by comparing the
kernel's current kstat chain ID (KCID), which is incremented every time the kstat chain changes, to the user's KCID, kc->kc_chain_id. If
the KCIDs match, kstat_chain_update() does nothing. Otherwise, it deletes any invalid kstat headers from the user's kstat chain, adds any
new ones, and sets kc->kc_chain_id to the new KCID. All other kstat headers in the user's kstat chain are unmodified.
RETURN VALUES
Upon successful completion, kstat_chain_update() returns the new KCID if the kstat chain has changed and 0 if it has not changed. Other-
wise, it returns -1 and sets errno to indicate the error.
ERRORS
The kstat_chain_update() function will fail if:
EAGAIN The kstat was temporarily unavailable for reading or writing.
ENOMEM Insufficient storage space is available.
ENXIO The given kstat could not be located for reading.
EOVERFLOW The data for the given kstat was too large to be stored in the structure.
FILES
/dev/kstat kernel statistics driver
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Stable |
+-----------------------------+-----------------------------+
|MT-Level |Unsafe |
+-----------------------------+-----------------------------+
SEE ALSO
kstat(3KSTAT), kstat_lookup(3KSTAT), kstat_open(3KSTAT), kstat_read(3KSTAT), attributes(5)
SunOS 5.11 3 Aug 2004 kstat_chain_update(3KSTAT)