Sponsored Content
Top Forums Shell Programming and Scripting join files cisco command output Post 302470572 by durden_tyler on Wednesday 10th of November 2010 11:38:09 AM
Old 11-10-2010
Code:
$
$
$ cat ports
Gi2/11
Gi2/14
Gi2/15
Gi2/16
Gi2/17
$
$
$ cat showintstatus
Gi2/11 serverusa connected 176 full 1000 10/100/1000BaseT
Gi2/14 serverusa connected 199 full 1000 10/100/1000BaseT
Gi2/20 serverusa connected 210 full 1000 10/100/1000BaseT
Gi2/16 serverusa connected 220 full 1000 10/100/1000BaseT
$
$
$ cat showmacaddresstable
176 0019b9e365d6 Gi2/11
176 001d09f0a40d Gi2/11
176 002497f8e8cb Gi2/11
199 0001d7711f05 Gi2/14
210 0001e9933y08 Gi2/20
230 0002w7654z01 Gi2/17
$
$
$ ##
$ awk 'FILENAME == "ports" {x[$0] = "y"}
       FILENAME == "showintstatus" && x[$1] == "y" {x[$1] = $0}
       FILENAME == "showmacaddresstable" && x[$3] != "" && x[$3] != "y" {print x[$3],$0}
      ' ports showintstatus showmacaddresstable
Gi2/11 serverusa connected 176 full 1000 10/100/1000BaseT 176 0019b9e365d6 Gi2/11
Gi2/11 serverusa connected 176 full 1000 10/100/1000BaseT 176 001d09f0a40d Gi2/11
Gi2/11 serverusa connected 176 full 1000 10/100/1000BaseT 176 002497f8e8cb Gi2/11
Gi2/14 serverusa connected 199 full 1000 10/100/1000BaseT 199 0001d7711f05 Gi2/14
$
$

tyler_durden
This User Gave Thanks to durden_tyler For This Post:
 

9 More Discussions You Might Find Interesting

1. Filesystems, Disks and Memory

using join command for files

Hi, I have to join 2 files based on two key field columns. But join command allows to give only one key column for fetching.So kindly update me whether i can compare 2 files based on two key columns or more than one key column.If so what is the syntax to compare it. With thanks in advance,... (12 Replies)
Discussion started by: subra
12 Replies

2. OS X (Apple)

Command line tool to join multiple .wmv files?

I need a simple command line executable that allows me to join many wmv files into one output wmv file, preferrably in a simple way like this: wmvjoin file1.wmv file2.wmv .... > outputfile.wmv So what I want is the wmv-equivalent of mpgtx I cannot find it on internet. Thanks. (2 Replies)
Discussion started by: karman
2 Replies

3. Shell Programming and Scripting

join (pls help on join command)

Hi, I am a new learner of join command. Some result really make me confused. Please kindly help me. input: file1: LEO oracle engineer 210375 P.Jones Office Runner ID897 L.Clip Personl Chief ID982 S.Round UNIX admin ID6 file2: Dept2C ID897 6 years Dept5Z ID982 1 year Dept3S ID6 2... (1 Reply)
Discussion started by: summer_cherry
1 Replies

4. UNIX for Dummies Questions & Answers

Join 2 files with multiple columns: awk/grep/join?

Hello, My apologies if this has been posted elsewhere, I have had a look at several threads but I am still confused how to use these functions. I have two files, each with 5 columns: File A: (tab-delimited) PDB CHAIN Start End Fragment 1avq A 171 176 awyfan 1avq A 172 177 wyfany 1c7k A 2 7... (3 Replies)
Discussion started by: InfoSeeker
3 Replies

5. UNIX for Dummies Questions & Answers

how to join two files using "Join" command with one common field in this problem?

file1: Toronto:12439755:1076359:July 1, 1867:6 Quebec City:7560592:1542056:July 1, 1867:5 Halifax:938134:55284:July 1, 1867:4 Fredericton:751400:72908:July 1, 1867:3 Winnipeg:1170300:647797:July 15, 1870:7 Victoria:4168123:944735:July 20, 1871:10 Charlottetown:137900:5660:July 1, 1873:2... (2 Replies)
Discussion started by: mindfreak
2 Replies

6. UNIX for Dummies Questions & Answers

How to use the join command to obtain tab delimited text files as an output?

How do you use the join command and obtain tab delimited text files as an output? Thanks! (2 Replies)
Discussion started by: evelibertine
2 Replies

7. UNIX for Dummies Questions & Answers

How to use the the join command to join multiple files by a common column

Hi, I have 20 tab delimited text files that have a common column (column 1). The files are named GSM1.txt through GSM20.txt. Each file has 3 columns (2 other columns in addition to the first common column). I want to write a script to join the files by the first common column so that in the... (5 Replies)
Discussion started by: evelibertine
5 Replies

8. Shell Programming and Scripting

How to join output of two command in same line?

Hi I am trying to figureout how to join output of two command in unix in the same line. for e.g. $ankit : df -h | egrep -w /home | awk '{print -n $1 "\t" $5}' ;stat --format=%a /home Output: 0148G /home 775 I want this output as... 0148G /home 775 Please let me know if you... (7 Replies)
Discussion started by: kotak86
7 Replies

9. Shell Programming and Scripting

Join two files combining multiple columns and produce mix and match output

I would like to join two files when two columns in each file matches with each other and then produce an output when taking multiple columns. Like I have file A 1234,ABCD,23,JOHN,NJ,USA 2345,ABCD,24,SAM,NY,USA 5678,GHIJ,24,TOM,NY,USA 5678,WXYZ,27,MAT,NJ,USA and file B ... (2 Replies)
Discussion started by: mady135
2 Replies
ieee802.3(5)						Standards, Environments, and Macros					      ieee802.3(5)

NAME
ieee802.3, cap_autoneg, cap_1000fdx, cap_1000hdx, cap_100fdx, cap_100hdx, cap_10fdx, cap_10hdx, cap_rem_fault, cap_pause, cap_asmpause, adv_cap_autoneg, adv_cap_1000fdx, adv_cap_1000hdx, adv_cap_100fdx, adv_cap_100hdx, adv_cap_10fdx, adv_cap_10hdx, adv_cap_pause, adv_cap_asmpause, adv_rem_fault, lp_cap_autoneg, lp_cap_1000fdx, lp_cap_1000hdx, lp_cap_100fdx, lp_cap_100hdx, lp_cap_10fdx, lp_cap_10hdx, lp_cap_pause, lp_cap_asmpause, lp_rem_fault, xcvr_addr, xcvr_id, xcvr_inuse, link_up, link_duplex, link_pause, link_asmpause - Ethernet mii kstat and ndd parameters DESCRIPTION
This page describes the kernel statistics and the ndd(1M) configuration parameters used to monitor and configure the Ethernet physical layer. The cap_* parameters exist in the kernel statistics for an Ethernet device. The parameters describe the maximum capability of a device. When the value of a statistic is 1, the device has the capability described. When the value is 0, the device does not have the capability. The exceptions to this rule are the cap_asmpause and cap_pause parameters which are explained later in the page. cap_autoneg Capable of auto-negotiation cap_1000fdx Capable of 1000 full duplex operation cap_1000hdx Capable of 1000 half duplex operation cap_100fdx Capable of 100 full duplex operation cap_100hdx Capable of 100 half duplex operation cap_10fdx Capable of 10 full duplex operation cap_10hdx Capable of 10 half duplex operation cap_rem_fault Capable of reporting locally detected faults to link partner The adv_cap_* parameters exist in the kernel statistics and represent a mirror image of the ndd adv_*_cap parameter list for an Ethernet device. The ndd adv_*_cap tuning parameters allow fine grain control of the Ethernet device physical layer. The parameters are also a sub- set of the cap_* statistics. If the cap_* value is 0, the corresponding adv_cap_* must also be 0. The exceptions to this rule are the adv_cap_asmpause and adv_cap_pause parameters. When auto-negotiation is enabled, the adv_*_cap statistics show which capabilities are advertised to the link partner. When auto-negotia- tion is disabled in forced mode, the statistics precisely show how a link should function and that it must be matched on the link partner to achieve a valid link up. Statistics with values other than 0 and 1 are also described in the following. adv_cap_autoneg Advertise auto-negotiation capability adv_cap_1000fdx Advertise 1000 full duplex capability adv_cap_1000hdx Advertise 1000 half duplex capability adv_cap_100fdx Advertise 100 full duplex capability adv_cap_100hdx Advertise 100 half duplex capability adv_cap_10fdx Advertise 10 full duplex capability adv_cap_10hdxv Advertise 10 half duplex capability adv_rem_fault Fault value reported by the local system to the peer 0 Link is good 1 Off line 2 Link failure 3 Auto-negotiation failure The lp_cap_* parameters exist as kernel statistics for an Ethernet device. The statistics are the advertised capabilities provided by the link partner on completion of auto-negotiation. If the capabilities match the capabilities provided in the local advertisement, the link can proceed to a link up state. If no match is found, the link remains down. In two other instances, lp_cap_* values might all be zero: when a cable is not present, when forced mode is enabled. lp_cap_autoneg Link partner advertises auto-negotiation capability lp_cap_1000fdx Link partner advertises 1000 full duplex capability lp_cap_1000hdx Link partner advertises 1000 half duplex capability lp_cap_100fdx Link partner advertises 100 full duplex capability lp_cap_100hdx Link partner advertises 100 half duplex capability lp_cap_10fdx Link partner advertises 10 full duplex capability lp_cap_10hdx Link partner advertises 10 half duplex capability lp_rem_fault Fault value the remote system reports 0 Link is good 1 Off line 2 Link failure 3 Auto-negotiation failure The xcvr_* kernel statistics provide information about the physical layer device that is in use. xcvr_addr MII address in the 0 to 31 range of the physical layer device in use for a given Ethernet device xcvr_id MII transceiver manufacturer and device ID xcvr_inuse MII transceiver type, based on the following list: 0 other Undefined 1 none MII present, but nothing connected 2 10Mb/s 10Mb/s Manchester encoding 3 100BaseT4 100 Mb/s 8B/6T 4 100BaseX 100 Mb/s 4B/5B 5 100BaseT2 100 Mb/s PAM5X5 6 1000BaseX 1000 Mb/s 8B/10B 7 1000BaseT 1000 Mb/s 4D-PAM5 The above values define maximum capability. In many cases, lower speeds can occur. The cap_* statistics must be viewed to establish the range of capability. The link_* kernel statistics show the link state at the local end of the connection. link_up 1 Link is up 0 Link is down link_duplex 2 Full duplex link 1 Half duplex link 0 Unknown The cap_asmpause, cap_pause, adv_cap_asmpause, and adv_cap_pause parameters do not follow the rules of other cap_* and adv_cap_* kstats or parameters. cap_pause The meaning of this statistic depends on the value provided by cap_asmpause. if cap_asmpause = 1, pause one direction 1 Send pause frames when there is receive congestion. 0 Pause transmission when a pause frame is received. if cap_asmpause = 0, pause in either direction 1 Send pause frames when there is receive congestion, and pause transmission when a pause frame is received. 0 Pause capability is not available in either direction. cap_asmpause Asymmetric pause capability The adv_cap_pause and adv_cap_asmpause statistics are limited by the available settings for cap_pause and cap_asmpause. For a device that is fully capable of pausing both Rx (receive) and Tx (transmit) operations, the settings available are defined in the truth table that fol- lows the adv_cap_pause and adv_cap_asmpause parameter descriptions below. adv_cap_pause The meaning of this statistic depends on the value provided by adv_cap_asmpause. if adv_cap_asmpause = 1 1 Send pause frames when there is receive congestion. 0 Pause transmission when a pause frame is received. if adv_cap_asmpause = 0 1 Send pause frames when there is receive congestion, and pause transmission when a pause frame is received. 0 Pause capability is not available in either direction. adv_cap_asmpause Asymmetric pause capability The cap_asmpause and cap_pause statistics show the capability of a device and also limit the legal setting for adv_cap_asmpause and adv_cap_pause. The following truth table describes the available adv_cap_asmpause and adv_cap_pause settings limited by cap_asmpause and cap_pause statistics. The abbreviations below are used in the table. CA cap_asmpause CP cap_pause AA adv_cap_asmpause AP adv_cap_pause CP CA AP AA Description 0 0 0 0 No pause in use 0 0 x x Device not pause capable, cannot set 0 1 0 0 Asymmetric Rx pause capable, but not advertised 0 1 0 1 Asymmetric Rx pause capable and advertised 0 1 1 0 Asymmetric Rx pause capable, making it impossible advertise symmetric pause 0 1 1 1 Asymmetric Rx pause capable, making it impossible advertise asymmetric Tx pause 1 0 0 0 Symmetric pause capable, but not advertised 1 0 0 1 Symmetric pause capable, advertis- ing asymmetric Rx pause only 1 0 1 0 Symmetric pause capable, advertis- ing symmetric Rx and Tx pause capa- bility 1 0 1 1 Symmetric pause capable, advertis- ing asymmetric Tx pause only 1 1 0 0 Asymmetric Tx pause capable, but not advertised 1 1 0 1 Asymmetric Tx pause capable, making it impossible to advertise Asymmet- ric Rx pause 1 1 1 0 Asymmetric Tx pause capable, making it impossible advertise symmetric pause 1 1 1 1 Asymmetric Tx pause capable and advertised In the cases above, an error is posted when a device driver cannot advertise. A new setting is ignored and values revert to the previous setting. The lp_cap_pause and the lp_cap_asmpause provide the advertised capabilities of the link partners. lp_cap_pause The meaning of this statistic depends on the value provided by lp_cap_asmpause. if lp_cap_asmpause = 1 1 Send pause frames when there is receive congestion. 0 Pause transmission when a pause frame is received. if lp_cap_asmpause = 0 1 Send pause frames when there is receive congestion, and pause transmission when a pause frame is received. 0 Pause capability is not available in either direction. lp_cap_asmpause Asymmetric pause capability When adv_*pause_cap and lp_*pause_cap are compared on completion of auto-negotiation, the chosen flow control mechanism for the link depends on what is most meaningful. link_asmpause 1 indicates flow control in one direction. 0 indicates flow control in both directions when link_pause is set to one. link_pause if link_asmpause = 0 1 Flow control in both Rx and Tx directions is available. 0 No flow control available on the link. if link_asmpause = 1 1 The local station will honor received pause frames by temporarily suspending transmit of further frames. 0 In the event of receive congestion, the local station will transmit a pause frame to the peer. lp_cap_asmpause Asymmetric pause capability The following truth table illustrates the meaningful flow control combinations related to local and link partner configurations. The abbreviations below are used in the table. AA adv_cap_asmpause AP adv_cap_pause LAC lp_cap_asmpause LPC lp_cap_pause LA link_asmpause LP link_pause AA AP LAC LPC LA LP Description 1 0 1 1 1 0 Local station will Tx a pause when Rx is congested. 0 1 0 1 0 1 Flow control in both Rx and Tx directions. x 1 1 0 1 1 Local station will honor received Pause frames by temporarily sus- pending Transmit. x x x x 0 0 All other combinations: Flow con- trol not avilable on the link When forced mode is enabled, the current setting of adv_cap_asmpause and adv_cap_pause are used for the link. The link_asmpause and link_pause become equal to the current adv_cap_asmpause and adv_cap_pause settings. The above table also applies in forced mode, but the link partner configuration must be checked to verify that flow control is operating on the link. SEE ALSO
ndd(1M), driver.conf(4), bge(7D), ce(7D), dlpi(7P), eri(7D), ge(7D), gld(7D), hme(7D), qfe(7D) NOTES
When adv_cap_autoneg is set to 0, the highest priority speed and duplex is used for forced mode. The highest priority is the highest speed at full duplex. The lowest priority is the lowest speed at half duplex. MII transceivers can exist internally to a system or can be connected to an external MII connector. Typically, an internal transceiver has an xcvr_addr of 1, while an external connection has an xcvr_addr of 0. SunOS 5.10 13 Sep 2004 ieee802.3(5)
All times are GMT -4. The time now is 08:36 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy