Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Grep certain lines with condition Post 302803571 by Don Cragun on Tuesday 7th of May 2013 05:13:26 AM
Old 05-07-2013
Radius,
Your specification is extremely vague. Is the 2nd field to be treated as
  1. a string (9C > 60C),
  2. a number followed by a character to be ignored (60C > 9C),
  3. a temperature in degrees (1C > 32F), or
  4. something else (???)?
If it is a temperature, are some values ever given in Fahrenheit or Kelvin? Does the sort need to convert Centigrade, Fahrenheit, and Kelvin to a common scale and sort by increasing temperatures independent of scale used? Or, will all temperatures be reported in Centigrade?

If it is something else, what?

So far, vidyadhar85's sort command assumes #2 and MadeInGermany's awk script assumes #1.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

grep command with AND condition

I want to do a grep with AND condition. I have three files. file1.txt ======== UNIX ...... WINDOWS ........ ORACLE file2.txt ======== UNIX ....... WINDOWS ...and many such files in a directory (6 Replies)
Discussion started by: prasperl
6 Replies

2. Homework & Coursework Questions

Grep line above X condition

1. The problem statement, all variables and given/known data: I have to grep a data file called datebook.txt. The last information in each line is a salary. I have to grep all the lines which precede those lines with 6 figure salaries. I can't SID it, or use Perl. It has to be grep (or egrep or... (3 Replies)
Discussion started by: DrSammyD
3 Replies

3. Shell Programming and Scripting

grep inside if condition - need help

hi i need help with below code. if ] then log "Exiting the script as ID= NULL" log "Please run script first." fi i am calling grep inside this but its not running any ideas why ?? input file is like this -- Msg 102, Level 20, State 1: Server... (4 Replies)
Discussion started by: dazdseg
4 Replies

4. Shell Programming and Scripting

use awk pick value from lines as condition for grep

Hi Folks! I have a file like this 000000006 dist:0.0 FILE ./MintRoute/MultiHopWMEWMA.nc LINE:305:1 NODE_KIND:131 nVARs:4 NUM_NODE:66 TBID:733 TEID:758 000000000 dist:0.0 FILE ./Route/MultiHopLEPSM.nc LINE:266:1 NODE_KIND:131 nVARs:4 NUM_NODE:66 TBID:601 TEID:626 000000001 ... (2 Replies)
Discussion started by: jackoverflow
2 Replies

5. Shell Programming and Scripting

Perl XML, find matching condition and grep lines and put the lines somewhere else

Hi, my xml files looks something like this <Instance Name="New York"> <Description></Description> <Instance Name="A"> <Description></Description> <PropertyValue Key="false" Name="Building A" /> </Instance> <Instance Name="B"> ... (4 Replies)
Discussion started by: tententen
4 Replies

6. Shell Programming and Scripting

grep in the if condition

Hi, In this code can able to match the pattern without case sensitive. Is that possible? if u knw plz help me... code: echo "Enter name to search" read n if ; echo "name found" else echo "Not Found" fi (8 Replies)
Discussion started by: boopal
8 Replies

7. Shell Programming and Scripting

Where condition in grep or awk?

Dear All, I need help.. I am having a csv file. Home_TITLE,People_TITLE,Repo_ALIAS HMN5530,RKY5807,/mine_repo/rike001 HMN5530,SRY6443,/mine_repo/rike001 HMN5530,ARDY001,/mine_repo/rike001 If i have two value in varible RKY5807, HMN5530. how can fetch and store another value... (6 Replies)
Discussion started by: yadavricky
6 Replies

8. UNIX for Dummies Questions & Answers

How to grep with certain condition?

hi all, i have an xml what i have to do is to search for the source id(s1) and if it matches with that in xml then extract the file mask from the name of the file i.e if the file name is idr_%YYYY%%MM%%DD%_%N%.idr then , i want the part after first % and before last % ie in this case ... (5 Replies)
Discussion started by: ramsavi
5 Replies

9. UNIX for Dummies Questions & Answers

Grep with condition

I have file input AAAA_XX_Start> rlong . 0W 130526-11:36:13 10.128.13.226 9.0j RBS_NODE_MODEL_N_1_50 stopfile=/tmp/13019 .. ================================================================================================================= MO ... (2 Replies)
Discussion started by: radius
2 Replies
NETWORKCTL(1)							    networkctl							     NETWORKCTL(1)

NAME
networkctl - Query the status of network links SYNOPSIS
networkctl [OPTIONS...] COMMAND [LINK...] DESCRIPTION
networkctl may be used to introspect the state of the network links as seen by systemd-networkd. Please refer to systemd- networkd.service(8) for an introduction to the basic concepts, functionality, and configuration syntax. OPTIONS
The following options are understood: -a --all Show all links with status. -h, --help Print a short help text and exit. --version Print a short version string and exit. --no-legend Do not print the legend, i.e. column headers and the footer with hints. --no-pager Do not pipe output into a pager. COMMANDS
The following commands are understood: list [LINK...] Show a list of existing links and their status. If no further arguments are specified shows all links, otherwise just the specified links. Produces output similar to: IDX LINK TYPE OPERATIONAL SETUP 1 lo loopback carrier unmanaged 2 eth0 ether routable configured 3 virbr0 ether no-carrier unmanaged 4 virbr0-nic ether off unmanaged 4 links listed. status [LINK...] Show information about the specified links: type, state, kernel module driver, hardware and IP address, configured DNS servers, etc. When no links are specified, an overall network status is shown. Also see the option --all. Produces output similar to: State: routable Address: 10.193.76.5 on eth0 192.168.122.1 on virbr0 169.254.190.105 on eth0 fe80::5054:aa:bbbb:cccc on eth0 Gateway: 10.193.11.1 (CISCO SYSTEMS, INC.) on eth0 DNS: 8.8.8.8 8.8.4.4 lldp [LINK...] Show discovered LLDP (Link Layer Discovery Protocol) neighbors. If one or more link names are specified only neighbors on those interfaces are shown. Otherwise shows discovered neighbors on all interfaces. Note that for this feature to work, LLDP= must be turned on on the specific interface, see systemd.network(5) for details. Produces output similar to: LINK CHASSIS ID SYSTEM NAME CAPS PORT ID PORT DESCRIPTION enp0s25 00:e0:4c:00:00:00 GS1900 ..b........ 2 Port #2 Capability Flags: o - Other; p - Repeater; b - Bridge; w - WLAN Access Point; r - Router; t - Telephone; d - DOCSIS cable device; a - Station; c - Customer VLAN; s - Service VLAN, m - Two-port MAC Relay (TPMR) 1 neighbors listed. label Show numerical address labels that can be used for address selection. This is the same information that ip-addrlabel(8) shows. See RFC 3484[1] for a discussion of address labels. Produces output similar to: Prefix/Prefixlen Label ::/0 1 fc00::/7 5 fec0::/10 11 2002::/16 2 3ffe::/16 12 2001:10::/28 7 2001::/32 6 ::ffff:0.0.0.0/96 4 ::/96 3 ::1/128 0 EXIT STATUS
On success, 0 is returned, a non-zero failure code otherwise. SEE ALSO
systemd-networkd.service(8), systemd.network(5), systemd.netdev(5), ip(8) NOTES
1. RFC 3484 https://tools.ietf.org/html/rfc3484 systemd 237 NETWORKCTL(1)
All times are GMT -4. The time now is 09:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy