03-11-2008
remove space characters
hello
I have this output
ifspeed 100000000
ifspeed 100000000
collisions 413
collisions 10
duplex full
duplex full
from
kstat bnx | grep ifspeed
kstat bnx | grep collisions
kstat bnx | grep duplex
I want to get
ifspeed: 100000000
ifspeed:100000000
collisions: 413
collisions: 10
duplex: full
duplex: full
So remove the white charcters and add : between both fields.
Any idea?
thanks
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
TXP(4) BSD Kernel Interfaces Manual TXP(4)
NAME
txp -- 3Com 3XP Typhoon/Sidewinder (3CR990) Ethernet interface
SYNOPSIS
To compile this driver into the kernel, place the following line in your kernel configuration file:
device txp
Alternatively, to load the driver as a module at boot time, place the following line in loader.conf(5):
if_txp_load="YES"
DESCRIPTION
The txp interface provides access to the 10Mb/s and 100Mb/s Ethernet networks via the 3Com Typhoon/Sidewinder chipset.
Basic Ethernet functions are provided as well as support for vlan(4) tag removal and insertion assistance, receive ip(4), tcp(4), and udp(4)
checksum offloading, and transmit ip(4) checksum offloading. There is currently no support for transmit tcp(4) or udp(4) checksum offload-
ing, tcp(4) segmentation, nor ipsec(4) acceleration.
When a txp interface is brought up, by default, it will attempt to auto-negotiate the link speed and duplex mode. The speeds, in order of
attempt, are: 100Mb/s Full Duplex, 100Mb/s Half Duplex, 10 Mb/s Full Duplex, and 10 Mb/s Half Duplex.
The txp supports several media types, which are selected via the ifconfig(8) command. The supported media types are:
media autoselect
Attempt to autoselect the media type (default)
media 100baseTX mediaopt full-duplex
Use 100baseTX, full duplex
media 100baseTX [mediaopt half-duplex]
Use 100baseTX, half duplex
media 10baseT mediaopt full-duplex
Use 10baseT, full duplex
media 10baseT [mediaopt half-duplex]
Use 10baseT, half duplex
HARDWARE
The txp driver supports the following cards:
o 3Com 3CR990-TX-95
o 3Com 3CR990-TX-97
o 3Com 3cR990B-TXM
o 3Com 3CR990SVR95
o 3Com 3CR990SVR97
o 3Com 3cR990B-SRV
SEE ALSO
altq(4), arp(4), inet(4), intro(4), ip(4), miibus(4), tcp(4), udp(4), vlan(4), ifconfig(8)
HISTORY
The txp driver first appeared in OpenBSD 2.9.
BSD
January 26, 2012 BSD