Sponsored Content
Top Forums UNIX for Beginners Questions & Answers UNIX script to compare 3rd column value with first column and display Post 303033464 by sekhar.lsb on Friday 5th of April 2019 03:05:44 PM
Old 04-05-2019
UNIX script to compare 3rd column value with first column and display

Thank you so much, above code is working fine.
I have question, in first column value is same for two or more columns then in out put is skipping duplicate rows
Now my input is like below:

Code:
rtr1	        Router	EPIC3	Targetdefinition
Exp1	Expres	rtr1	Router
SQL         SrcQual	Exp1	Expres
rtr1	Router	EPIC1	Targetdefinition

Expecting output like
Code:
SQL	SrcQual	Exp1	Expres
Exp1	Expres	rtr1	Router
rtr1	Router	EPIC1	Targetdefinition
rtr1	        Router	EPIC3	Targetdefinition

Moderator's Comments:
Mod Comment please use code tags

Last edited by vgersh99; 04-05-2019 at 04:07 PM.. Reason: Code tags, please!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Compare files column to column based on keys

Here is my situation. I need to compare two tab separated files (diff is not useful since there could be known difference between files). I have found similar posts , but not fully matching.I was thinking of writing a shell script using cut and grep and while loop but after going thru posts it... (2 Replies)
Discussion started by: blackjack101
2 Replies

2. Shell Programming and Scripting

Compare Two Files(Column By Column) In Perl or shell

Hi, I am writing a comparator script, which comapre two txt files(column by column) below are the precondition of this comparator 1)columns of file are not seperated Ex. file1.txt 8888812341181892 1243548895685687 8945896789897789 1111111111111111 file2.txt 9578956789567897... (2 Replies)
Discussion started by: kumar96877
2 Replies

3. Shell Programming and Scripting

AWK script to create max value of 3rd column, grouping by first column

Hi, I need an awk script (or whatever shell-construct) that would take data like below and get the max value of 3 column, when grouping by the 1st column. clientname,day-of-month,max-users ----------------------------------- client1,20120610,5 client2,20120610,2 client3,20120610,7... (3 Replies)
Discussion started by: ckmehta
3 Replies

4. UNIX for Dummies Questions & Answers

sort a unix file by 3rd column

Hi, Can anybody tell me how to sort a unix file by 3rd column and not by ltr? Please help Thanks in advance (2 Replies)
Discussion started by: vinnyvirk
2 Replies

5. UNIX for Dummies Questions & Answers

Search word in 3rd column and move it to next column (4th)

Hi, I have a file with +/- 13000 lines and 4 column. I need to search the 3rd column for a word that begins with "SAP-" and move/skip it to the next column (4th). Because the 3rd column need to stay empty. Thanks in advance.:) 89653 36891 OTR-60 SAP-2 89653 36892 OTR-10 SAP-2... (2 Replies)
Discussion started by: AK47
2 Replies

6. Shell Programming and Scripting

Help with compare two column and print out column with smallest number

Input file : 5 20 500 2 20 41 41 0 23 1 Desired output : 5 2 20 0 1 By comparing column 1 and 2 in each line, I hope can print out the column with smallest number. I did try the following code, but it don't look good :( (2 Replies)
Discussion started by: perl_beginner
2 Replies

7. Shell Programming and Scripting

Compare 3rd column in 2 files

I have the following 2 files. File 1 08FB,000192602673,10000000c9a6b240 0121,000192602673,20000025b550101f 0121,000192602673,20000025b550100f 08FA,000192602673,10000000c9a6b240 File 2 18F2,000195702363,10000000c9a6b240 18F3,000195702363,10000000c9a6b240... (2 Replies)
Discussion started by: kieranfoley
2 Replies

8. Shell Programming and Scripting

Changing values only in 3rd column and 4th column

#cat file testing test! nipw asdkjasjdk ok! what !ok host server1 check_ssh_disk!102.56.1.101!30!50!/ other host server 2 des check_ssh_disk!192.6.1.10!40!30!/ #grep check file| awk -F! '{print $3,$4}'|awk '{gsub($1,"",$1)}1' 50 30 # Output: (6 Replies)
Discussion started by: kenshinhimura
6 Replies

9. Shell Programming and Scripting

Solution for replacement of 4th column with 3rd column in a file using awk/sed preserving delimters

input "A","B","C,D","E","F" "S","T","U,V","W","X" "AA","BB","CC,DD","EEEE","FFF" required output: "A","B","C,D","C,D","F" "S", T","U,V","U,V","X" "AA","BB","CC,DD","CC,DD","FFF" tried using awk but double quotes not preserving for every field. any help to solve this is much... (5 Replies)
Discussion started by: khblts
5 Replies

10. Shell Programming and Scripting

Need awk or Shell script to compare Column-1 of two different CSV files and print if column-1 matche

Example: I have files in below format file 1: zxc,133,joe@example.com cst,222,xyz@example1.com File 2 Contains: hxd hcd jws zxc cst File 1 has 50000 lines and file 2 has around 30000 lines : Expected Output has to be : hxd hcd jws (5 Replies)
Discussion started by: TestPractice
5 Replies
rtradvd.conf(4) 					     Kernel Interfaces Manual						   rtradvd.conf(4)

NAME
rtradvd.conf - configuration file for router advertisement daemon DESCRIPTION
This file describes the information used by rtradvd(1M) when constructing IPv6 router advertisement packets for a specific interface as specified by RFC 2461 ("Neighbor Discovery for IP Version 6"). This file is read by at initialization time or upon reception of signal configuration consists of two general statements and one substatement that is used only by the statement. All statements and substatements must end with a semicolon. Statements are composed of keywords separated by white space, which can be any combination of blanks and tabs. The user may create an entry for each interface that is to be enabled for Router Advertisements. Any configuration information not speci- fied in the individual or entry is inherited from the statement. In absence of a statement or specific keywords, the values of options are set according to their default values as defined in RFC-2461. The statement can be used to define global values for both and keywords. The statement is defined as: defaults { # list of interface specific keyword-value pairs; # list of prefixinfo specific keyword-value pairs; }; The statement is defined as: interface interface-name { # list of interface specific keyword-value pairs; prefixinfo prefix/prefixlen { # list of prefixinfo specific keyword-value pairs; }; }; The specifies the "prefix" and "prefix length" to be advertised on that interface. The and specific keywords (if specified) have a precedence over the keywords defined in the statement. Comments begin with the pound character (#) and continue to the end of the line. INTERFACE SPECIFIC OPTIONS
The following basic keywords and values are defined in RFC 2461: Enables or disables sending of periodic Router Advertisements and responding to Router Solicitations. DEFAULT: off Specifies the maximum time, in seconds, between sending unsolicited multicast Router Advertisements from the interface. Valid values are between 4 and 1800 seconds, inclusive. When using Mobile IPv6 extension, the minimum valid value allowed drops to 0.07. DEFAULT: 600 Specifies the minimum time, in seconds, between sending unsolicited multicast Router Advertisements from the interface. Valid values are between 3 seconds and .75 * inclusive. The default is 200 seconds. When using Mobile IPv6 extension, the minimum valid value allowed drops to 0.03. DEFAULT: 0.33 * Enables or disables the setting of the "Managed Address Configuration" flag in Router Advertisements. DEFAULT: off Enables or disables the setting of the "Other Stateful Configuration" flag in Router Advertisements. DEFAULT: off Specifies the value to be placed in MTU option sent by the router. A value of zero means unspecified. When set to 0, does not include the MTU option in Router Advertisements. It can not be greater than the maximum allowed MTU for a specific interface. DEFAULT: 0 Specifies a time, in milliseconds,that is placed in the Reachable Time field in Router Advertisement messages. Valid values are between 0 and 3,600,000 (1 hour), inclusive. A value of zero means unspecified by this router. DEFAULT: 0 Specifies a time, in milliseconds, that is placed in the Retrans Timer field in Router Advertisement messages. A value of zero means unspecified by this router. DEFAULT: 0 Specifies the value to be placed in the Cur Hop Limit field in Router Advertisement messages sent by the router. A value of zero means unspecified by this router. DEFAULT: 64 Specifies a time, in seconds, that is placed in the Router Lifetime field in Router Advertisement messages. Valid values are 0 or between and 9000, inclusive. A value of zero indicates that the router is not to be used as a default router and should not appear in the default router list of the host receiving this Router Advertisement message. DEFAULT: 3 * Enables or disables the sending of the interface link-layer address option in outgoing Router Advertisement messages. DEFAULT: on Mobile IPv6 option. Enables or disables setting of the "Home Agent" flag field in Router Advertisement messages. When enabled, this indicates that the router sending this Router Advertisement messages is also functioning as a Mobile IPv6 home agent on this link. When enabled, the minimum values specified by Mobile IPv6 extension can be used for and DEFAULT: off Mobile IPv6 option. Specifies the length of time in seconds that the router is offering Mobile IPv6 Home Agent service. The maximum value is 65520 sec- onds (18.2 hours). A value of zero is not allowed. DEFAULT: Mobile IPv6 option. Specifies a preference level for the home agent sending this Router Advertisement. Higher values indicate a home agent is more preferable. If both the and are set to their default values, the Home Agent Information option will not be included in Router Advertisement messages sent by this Home Agent router. DEFAULT: 0 Mobile IPv6 option. Enables or disable the sending of Advertisement Interval Option in Router Advertisement messages. If this option is included in the message, the minimum limits specified by Mobile IPv6 extension for and can be used. DEFAULT: off PREFIX SPECIFIC OPTIONS
The following address prefix keywords and values are defined in RFC 2461: Specifies the valid lifetime of the address prefix, in seconds, to be placed in outgoing Router Advertisement messages. The symbolic name represents infinity. DEFAULT: 2592000 seconds (30 days) Specifies the preferred lifetime of the address prefix, in seconds, to be placed in outgoing Router Advertisement messages. The symbolic name represents infinity. DEFAULT: 604800 seconds (7 days) Sets or clears the On-link flag field in the Prefix Information option. DEFAULT: on Sets or clears the Autonomous Flag field in the Prefix Information option. DEFAULT: on Mobile IPv6 prefix option. Sets or clear the Router Flag field in the Prefix Information option. This indicates that the Prefix field, in addition to adver- tising the indicated prefix, contains a complete IP address assigned to the sending router. DEFAULT: off EXAMPLES
Three example configuration files are shown below for a system that has two interfaces. In these examples, the daemon will use default values defined in RFC-2461 for those keywords that are not specified in the configuration file. The second example uses statement to define some global keywords for the both interfaces and prefixes. Finally, the last example shows a Mobile IPv6 example. Example 1 interface lan1 { AdvCurHopLimit 32; AdvSendAdvertisement on; prefixinfo 2008:0:0:4::/64 { AdvValidLifetime 70100; AdvPreferredLifetime 50200; }; prefixinfo 2008:0:0:5::/64 { AdvValidLifetime 70100; AdvPreferredLifetime 50200; }; }; interface lan2 { AdvCurHopLimit 32; AdvRouterLifetime 0; AdvSendAdvertisement on; prefixinfo 2008:0:0:6::/64 { AdvValidLifetime 70100; AdvPreferredLifetime 50200; }; }; Example 1 specifies that the daemon should send Router Advertisement messages on both and must be (the default is The is set to 32 for both interfaces (default value is 64). The for the second interface is set to 0. It means the receiving hosts should not add this router in their list of "IPv6 default router". Example 2 defaults { AdvCurHopLimit 32; AdvSendAdvertisement on; AdvValidLifetime 70100; AdvPreferredLifetime 50200; }; interface lan1 { prefixinfo 2008:0:0:4::/64 { }; prefixinfo 2008:0:0:5::/64 { }; }; interface lan2 { AdvRouterLifetime 0; prefixinfo 2008:0:0:6::/64 { }; }; Same as Example 1 but using statement. Example 3 defaults { AdvSendAdvertisement on; MinRtrAdvInterval 2; MaxRtrAdvInterval 5; AdvHomeAgentFlag on; AdvHomeAgentLifetime 1200; AdvHomeAgentPreference 3; AdvIntervalOpt on; }; interface lan1 { prefixinfo 2008:0:0:4::/64 { }; prefixinfo 2008::5:210:83ff:fef7:7a9d/64 { AdvRouterAddress on; }; }; interface lan2 { prefixinfo 2008:0:0:6::9/64 { AdvRouterAddress on; AdvPreferredLifetime 18000; }; }; In this example, the Mobile IPv6 options will be included in the Router Advertisement messages. is turned to also advertise the global address of the router on and If the kernel part of Mobile IPv6 product is detected (see mip6mod(7)), the node also acts as "Home Agent" for the two prefixes configured with set on and In this case, the daemon enables processing of the four new ICMPv6 messages defined by Mobile IPv6 (see rtradvd(1M)). SEE ALSO
ndp(1M), rtradvd(1M), mip6mod(7), ndp(7P). 1. T. Narten, E. Nordmark, W. Simpson, RFC2461 , December 1998. 2. S. Thompson, T. Narten, RFC2462 , December 1998. 3. D. Johnson, C. Perkins, IETF document. rtradvd.conf(4)
All times are GMT -4. The time now is 10:54 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy