Sponsored Content
Top Forums Shell Programming and Scripting How to print the words in the same line with space or to the predefined line? Post 302396324 by div_Neev on Thursday 18th of February 2010 07:20:27 AM
Old 02-18-2010
Excellent !!!Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to get line number of different words if exists in same line

I have some txt files. I have to create another text file which contains the portion starting from the format "Date Sex Address" to the end of the file. While using grep -n on Date it also gives me the previous line containg Date. and also Date may be DATE in some files. My file is like this... (10 Replies)
Discussion started by: Amiya Rath
10 Replies

2. Shell Programming and Scripting

print only last two words of a line

can u help me out to print last two words of each sentence of a file. for example. contents of input file: i love songs my favourite songs sent songs all kind good buddy Ouput file should contain: love songs favourite songs sent all kind good buddy (5 Replies)
Discussion started by: pradeepreddy
5 Replies

3. Shell Programming and Scripting

Print two matched words from the same line

Hi experts I need to pick 2 matched words from the same line..... I have given below an example file eg: O14757 hsa04110 hsa04115 2 P38398 hsa04120 1 O15111 hsa04010 hsa04210 hsa04920 hsa04620 hsa04660 hsa04662 hsa05200 hsa05212 hsa05221 hsa05220 hsa05215 hsa05222 hsa05120 13 O14920... (4 Replies)
Discussion started by: binnybio
4 Replies

4. Shell Programming and Scripting

Copying x words from end of line to specific location in same line

Hello all i know it is pretty hard one but you will manage it all after noticing and calculating i find a rhythm for the file i want to edit to copy the last 12 characters in line but the problem is to add after first 25 characters in same line in other way too copy the last 12 characters... (10 Replies)
Discussion started by: princesasa
10 Replies

5. Shell Programming and Scripting

Count and print all repeating words in a line

Gurus, I have a file containing lines like this : Now, number of words in each line varies. My need is, if a word repeats in a line get it printed. Also total number of repeats. So, the output would be : Any help would be highly appreciated. Thanks & Regards (5 Replies)
Discussion started by: AshwaniSharma09
5 Replies

6. Shell Programming and Scripting

Remove all words after first space from each line

My file looks like: asd absjdd sdff vczxs wedssx c dasx ccc I need to keep asd sdff wedssx dasx How do I do that experts?:wall::wall: (1 Reply)
Discussion started by: hakermania
1 Replies

7. Shell Programming and Scripting

print number of words in each line

Hi, Please suggest a way to print number of words in the end of each line. <input file> red aunt house blue sky bat and ball game <output file> red aunt house 3 blue sky 2 bat and ball game 4 Thanks! (2 Replies)
Discussion started by: mira
2 Replies

8. Shell Programming and Scripting

awk until blank space and print next line

Hello and Happy New Year 2012! I have this example: 1,2,3 4,5,6 7,8,9 For that, I'm trying to get: 1,2,3 4,5,6 7,8,9 for that, I think this might work but doesnt work so far: awk '{for(i=1;i=NF;i++);sub(/\//,"",$i);print $i}' myfile (2 Replies)
Discussion started by: Gery
2 Replies

9. Shell Programming and Scripting

Search words in a line and print next 15 lines.

I have a text file ( basically a log file) and i have 2 words (alpha, beta), Now i want to search these two words in one line and then print next 15 lines in a temp file. there would be many lines with alpha and beta But I need only last occurrence with "alpha" and "beta" and next 15 lines. ... (4 Replies)
Discussion started by: kashif.live
4 Replies

10. Shell Programming and Scripting

Search words in multiple file line by line

Hi All I have to search servers name say like 1000+ "unique names" line by line in child.txt files in another file that is a master file where all server present say "master.txt",if child.txt's server name matches with master files then it print yes else no with server name. (4 Replies)
Discussion started by: netdbaind
4 Replies
LLDPCTL(8)						    BSD System Manager's Manual 						LLDPCTL(8)

NAME
lldpctl -- control LLDP daemon SYNOPSIS
lldpctl [-d] [-L location] [-P policy] [-O poe] [-o poe] [interface ...] DESCRIPTION
The lldpctl program controls lldpd(8) daemon. When no specific option is given, lldpctl displays the list of discovered neighbors along with some of their advertised capabilities. If some interfaces are given, only those interfaces will be displayed. The options are as follows: -d Enable more debugging information. -f format Choose the output format. Currently plain, xml and keyvalue formats are available. The default is plain. -L location Enable the transmission of LLDP-MED location TLV for the given interfaces. This option can be repeated several times to enable the transmission of the location in several formats. Several formats are accepted: Coordinate based location The format of location is 1:48.85667:N:2.2014:E:117.47:m:1 The first digit is always 1. It is followed by the latitude, a letter for the direction ( E or W for East or West), the longitude and a letter for the direction ( N or S ). The next figure is the altitude. It can be expressed in meters (the next letter is then m ) or in floors (the letter should be f ). The last digit is the datum. It can either be 1 (WGS84), 2 (NAD83) or 3 (NAD83/MLLW). Civic address The location can be expressed as an address. The format of the location is then 2:FR:6:Commercial Rd:3:Roseville:19:4 The first digit is always 2. The next two letters are the country code. Then, arguments are paired to form the address. The first member of the pair is a digit indicating the type of the second member. Here is the list of valid types: 0 Language 1 National subdivisions 2 County, parish, district 3 City, township 4 City division, borough, ward 5 Neighborhood, block 6 Street 16 Leading street direction 17 Trailing street suffix 18 Street suffix 19 House number 20 House number suffix 21 Landmark or vanity address 22 Additional location info 23 Name 24 Postal/ZIP code 25 Building 26 Unit 27 Floor 28 Room number 29 Place type 128 Script ECS ELIN This is a numerical string using for setting up emergency call. The format of the location is then the following: 3:0000000911 where the first digit should be 3 and the second argument is the ELIN number. When setting a location for a given port, all previous locations are erased. To erase all location, just use the empty string. There is currently no way to get the location from the command line. -P policy Enable the transmission of LLDP-MED Network Policy TLVs for the given interfaces. This option can be repeated several times to spec- ify different policies. Format (without spaces!): App-Type : U : T : VLAN-ID : L2-Prio : DSCP App-Type Valid application types (see ANSI/TIA-1057 table 12): 1 Voice 2 Voice Signaling 3 Guest Voice 4 Guest Voice Signaling 5 Softphone Voice 6 Video Conferencing 7 Streaming Video 8 Video Signaling U Unknown Policy Flag. 0 Network policy for the specified application type is defined. 1 Network policy for the specified application type is required by the device but is currently unknown. This is used by End- point Devices, not by Network Connectivity Devices. T Tagged Flag. 0 Untagged VLAN. In this case the VLAN ID and the Layer 2 Priority are ignored and only the DSCP value has relevance. 1 Tagged VLAN. VLAN-ID IEEE 802.1q VLAN ID (VID). A value of 1 through 4094 defines a VLAN ID. A value of 0 means that only the priority level is sig- nificant. L2-Prio IEEE 802.1d / IEEE 802.1p Layer 2 Priority, also known as Class of Service (CoS), to be used for the specified application type. 1 Background 2 Spare 0 Best Effort (default) 3 Excellent Effort 4 Controlled Load 5 Video 6 Voice 7 Network Control DSCP DiffServ/Differentiated Services Code Point (DSCP) value as defined in IETF RFC 2474 for the specified application type. Value: 0 (default per RFC 2475) through 63. Note: The class selector DSCP values are backwards compatible for devices that only support the old IP precedence Type of Service (ToS) format. (See the RFCs for what these values mean.) Examples: 1:0:1:500:6:46 Voice (1): not unknown (0), tagged (1), VLAN-ID 500, l2 prio Voice (6), DSCP 46 (EF, Expedited Forwarding) 2:0:1:500:3:24 Voice Signaling (2): not unknown (0), tagged (1), VLAN-ID 500, l2 prio Excellent Effort (3), DSCP 24 (CS3, Class Selector 3) -O poe Enable the transmission of LLDP-MED POE-MDI TLV for the given interfaces. One can act as a PD (power consumer) or a PSE (power provider). No check is done on the validity of the parameters while LLDP-MED requires some restrictions: o PD shall never request more power than physical 802.3af class. o PD shall never draw more than the maximum power advertised by PSE. o PSE shall not reduce power allocated to PD when this power is in use. o PSE may request reduced power using conservation mode o Being PSE or PD is a global paremeter, not a per-port parameter. lldpctl does not enforce this: a port can be set as PD or PSE. LLDP-MED also requires for a PSE to only have one power source (primary or backup). Again, lldpctl does not enforce this. Each port can have its own power source. The same applies for PD and power priority. LLDP-MED MIB does not allow this kind of repre- sentation. This option is distinct of -o option. You may want to use both options at the same time. The format of this option is (without spaces): type : source : priority : value type Valid types are: PSE Power Sourcing Entity (power provider) PD Power Device (power consumer) source Valid sources are: 0 Unknown 1 For PD, the power source is the PSE. For PSE, the power source is the primary power source. 2 For PD, the power source is a local source. For PSE, the power source is the backup power source or a power conservation mode is asked (the PSE may be running on UPS for example). 3 For PD, the power source is both the PSE and a local source. For PSE, this value should not be used. priority Four priorities are available: 0 Unknown priority 1 Critical 2 High 3 Low value For PD, the power value is the total power in tenth of watts required by a PD device from the PSE device. This value should range from 0 to 1023 tenth of watts. -o poe Enable the transmission of Dot3 POE-MDI TLV for the given interfaces. One can act as a PD (power consumer) or a PSE (power provider). This option is distinct of the -O option. You might want to use both. Contrary to LLDP-MED POE-MDI TLV, Dot3 POE-MDI TLV are strictly per-port values. The format of this option is (without spaces): type : supported : enabled : paircontrol : powerpairs : class [ : powertype : source : priority : requested : allocated ] type Valid types are: PSE Power Sourcing Entity (power provider) PD Power Device (power consumer) powerpairs Valid sources are: 1 The signal pairs only are in use. 2 The spare pairs only are in use. class Five classes are available: 1 class 0 2 class 1 3 class 2 4 class 3 5 class 4 0 no class supported, enabled and paircontrol can be set to to 0 or 1. supported means that MDI power is supported on the given port. enabled means that MDI power is enabled on the given port. paircontrol is used to indicate if the pair selection can be controlled on the given port. powertype, source, priority (and remaining values) are optional. They are only requested in conformance with 802.3at. type should be either 1 or 2. For the possible values of the next two fields, see the possible values of source and priority for LLDP-MED MDI/POE. requested and allocated are respectively the PD requested power value and the PSE allocated power value. This should be expressed in tenth of watts from 1 to 255. FILES
/var/run/lldpd.socket Unix-domain socket used for communication with lldpd(8). SEE ALSO
lldpd(8) AUTHORS
The lldpctl program was written by Vincent Bernat <bernat@luffy.cx>. BSD
July 16, 2008 BSD
All times are GMT -4. The time now is 06:42 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy