Sponsored Content
Top Forums Shell Programming and Scripting Any solution to get previous line in awk Post 302844351 by krishmaths on Sunday 18th of August 2013 11:51:42 PM
Old 08-19-2013
Hi Jotne,

Could you please explain the code?

Thanks!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk;sed appending line to previous line....

I know this has been asked before but I just can't parse the syntax as explained. I have a set of files that has user information spread out over two lines that I wish to merge into one: User1NameLast User1NameFirst User1Address E-Mail:User1email User2NameLast User2NameFirst User2Address... (11 Replies)
Discussion started by: walkerwheeler
11 Replies

2. Shell Programming and Scripting

Awk script to create new file based on previous line

Need help creating a script that does the following: Sort a file Compare the previous line "last field" with current line "last field" If they are the same, print output to a file If they are different print output to a new file The script should keep creating new files if the previous... (5 Replies)
Discussion started by: Muga801
5 Replies

3. Shell Programming and Scripting

awk get matched line's previous line

hi everyone, a b in c d e f in g output is: a e so awk search for "in", then print out the matched line's previuos line. Please advice. (11 Replies)
Discussion started by: jimmy_y
11 Replies

4. Shell Programming and Scripting

Awk help with source and previous line loop

Hello, I've written a ksh awk script to ping multiple servers and write the results to a file. That part is working ok. I then want to extract the names of only the server which are available. This is indicated by '1 packets received'. The server name actually appears above that line so I found... (4 Replies)
Discussion started by: Grueben
4 Replies

5. UNIX for Dummies Questions & Answers

Awk to print data from current and previous line

Hi guys, I have found your forum super useful. However, right now I am stuck on a seemingly "simple" thing in AWK. I have two columns of data, the first column in Age (in million years) and the second column is Convergence Rate (in mm/yr). I am trying to process my data so I can use it to... (2 Replies)
Discussion started by: awk_noob_456
2 Replies

6. Shell Programming and Scripting

Read column values from previous and next line using awk

Hi, I have a csv file which contains data that looks something like this: Key1 Key2 Key3 New_Key1 New_Key2 New_Key3 102 30 0 - - - 102 40 1 30 40 50 102 50 2 40 50 ... (4 Replies)
Discussion started by: Nishi_Licious
4 Replies

7. Shell Programming and Scripting

Remove previous line if next & previous lines have same 4th character.

I want to remove commands having no output. In below text file. bash-3.2$ cat abc_do_it.txt grpg10so>show trunk group all status grpg11so>show trunk group all status grpg12so>show trunk group all status GCPKNYAIGT73IMO 1440 1345 0 0 94 0 0 INSERVICE 93% 0%... (4 Replies)
Discussion started by: Raza Ali
4 Replies

8. Shell Programming and Scripting

awk script -print line when $2 > $2 of previous line

Hi all, From a while loop I am reading a sorted file where I want to print only the lines that have $1 match and $2 only when the difference from $2 from the previous line is > 30. Input would be like ... AN237 010 193019 0502 1 CSU Amoxycillin AN237 080 ... (2 Replies)
Discussion started by: gafoleyo73
2 Replies

9. Shell Programming and Scripting

awk to insert line previous to a pattern?

I have a very long line with certain patters embedded in there. I need to be able to read that line, and when it encounters that pattern, create a new line. I want the pattern to be the beginning of the new line. I thought sed or awk could do this, but everything I try in sed gives me a "sed... (2 Replies)
Discussion started by: Drenhead
2 Replies

10. Shell Programming and Scripting

awk to copy previous line matching a particular columns

Hello Help, 2356798 7689867 999 000 123678 20385907 9797 666 17978975 87468976 968978 98798 I am trying to have out put which actually look for the third column value of 9797 and then it insert line there after with first, second column value exactly as the previous line and replace the third... (3 Replies)
Discussion started by: Indra2011
3 Replies
EDOS-DEBCHECK(1)					      General Commands Manual						  EDOS-DEBCHECK(1)

NAME
Edos-debcheck - Check satisfiability of Debian package dependencies SYNOPSIS
edos-debcheck [option] ... [package] ... DESCRIPTION
edos-debcheck reads from standard input a set of Debian package descriptions, each of which is in the format of deb-control(5). For instance, the Packages files as found on a Debian mirror server, or in the directory /var/lib/apt/lists/ of a Debian system, are suitable as input to edos-debcheck. Packages may appear with multiple versions in this set. We say that a package is identified in this set by the pair consisting of the pack- age name and of the package version. A package (called goal) is called installable with respect to a set of packages if there exists a subset of the packages that - contains at most one version for each package name - contains the goal package (in any version, or a specific version) - all packages of the subset have their dependencies and conflicts satisfied in this subset. Pre-depends are treated like Depends, and Breaks are treated like Conflicts. Debcheck checks whether every package given as argument is installable with respect to the input set of packages. Specific versions can be specified by following the package name with the sign '=' and the version of the package (for instance, 'xemacs21=21.4.17-1'). If no pack- age name is given as argument then all packages of the input set are checked for satisfiability. The constraint solving algorithm is complete, that is it finds a solution whenever there exists one, even for multiple disjunctive depen- dencies and deep package conflicts. This problem is computationally infeasible in theory (that is, NP-complete), but can in practice be solved very efficiently for Packages files occurring actually in Debian. OPTIONS
-i file Specify an additional input file containing stanzas in deb-control(5) format. These packages are checked for installability the same way as packages read from standard input. -I file Specify an additional input file containing stanzas in deb-control(5) format. These packages that are not checked for installabil- ity but only used for resolving dependencies. -explain Explain the results -rules Print generated rules -failures Only show failures -successes Only show successes -checkonly list where list is a comma-separated list of package names. Check only for installability of packages with name in list (of any avail- able version). This means that if a package does not exist in the input pool then the test passes (since all available versions are in that case installable). However, a warning is issued in case a package mentionend in list is not available. In the context of this option, a package of the form src:p expands to the list of all packages that stem from the source package p. -quiet Supress warnings and progress/timing messages -xml Output results in XML format -help, --help Display this list of options EXIT CODE
The exit code is 0 when all packages that were asked to be checked (either explicitly with the -checkonly option, or because they exist in the package pool file) are available and found to be installable, it is 1 when a least one of these packages is available but not instal- lable, and it is 2 when at least one of the packages is not available but all available packages are found to be installable. Hence, the exit code 2 can occur only when the -checkonly option is used. EXAMPLE
Check which packages in a particular distribution are not installable and why: edos-debcheck -failures -explain < Packages where Packages is the file pertaining to that distribution, as for instance found in the directory /var/lib/apt/lists. Check whether the xemacs21 and debhelper packages are installable in a distribution described by the file Packages: edos-debcheck -explain -checkonly xemacs21,debhelper < Packages Check whether the package bibtex2html, and all binary packages stemming from the ocaml source package, are installable edos-debcheck -explain -checkonly bibtex2html,src:ocaml < Packages AUTHOR
Edos-debcheck has been written by Jerome Vouillon for the EDOS project. This man-page has been compiled by Ralf Treinen. SEE ALSO
deb-control(5) <http://www.edos-project.org> is the home page of the EDOS project. edos-rpmcheck(1) is the analogous tool for rpm packages. EDOS
2009-08-18 EDOS-DEBCHECK(1)
All times are GMT -4. The time now is 02:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy