Sponsored Content
Full Discussion: Printing out pattern in line
Top Forums Shell Programming and Scripting Printing out pattern in line Post 302147020 by FK_Daemon on Friday 23rd of November 2007 03:27:41 PM
Old 11-23-2007
Thanks for the replies. They helped me a lot.

I thought about matching everything between "/" and "." too, but I was a bit worried that even the "." might get cut off (not to mention that I am no ace when it comes to sed). Hopefully that won't occur. I will look more closely at ps -awww in the future as I run all my scripts on Solaris.

Thanks once again, you guys are awesome.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

find pattern delete line with pattern and line above and line below

I have a file that will sometimes contain a pattern. The pattern is this: W/D FRM CHK 00 I want to find any lines with this pattern, delete those lines, and also delete the line above and the line below. (1 Reply)
Discussion started by: nickg
1 Replies

2. Shell Programming and Scripting

find pattern, delete line with pattern and line above and line below

I have a file that will sometimes contain a pattern. The pattern is this: FRM CHK 0000 I want to find any lines with this pattern, delete those lines, and also delete the line above and the line below. (4 Replies)
Discussion started by: nickg
4 Replies

3. Shell Programming and Scripting

Need help in sed command [ printing a pattern + its line no or line no alone ]

Hello friends, Only very recently i started learning sed command...an i found that sed is faster in finding the patterns than some of my scripts that uses grep to check the patten inside a file using line by line search method which is time consuming. The below script... (4 Replies)
Discussion started by: frozensmilz
4 Replies

4. Shell Programming and Scripting

Printing previous line based on pattern using sed

Hi, I have a written a shell script to get the previous line based on the pattern. For example if a file has below lines: ---------------------------------------------- #UNBLOCK_As _per #As per 205.162.42.92 #BLOCK_As_per #----------------------- #input checks abc.com... (5 Replies)
Discussion started by: Anjan1
5 Replies

5. Shell Programming and Scripting

Grep the word from pattern line and update in subsequent lines till next pattern line reached

Hi, I have got the below requirement. please suggest. I have a file like, Processing Item is: /data/ing/cfg2/abc.txt /data/ing/cfg3/bgc.txt Processing Item is: /data/cmd/for2/ght.txt /data/kernal/config.klgt.txt I want to process the above file to get the output file like, ... (5 Replies)
Discussion started by: rbalaj16
5 Replies

6. UNIX for Dummies Questions & Answers

Printing nth and n+1th line after a pattern match

Hi , I want to print the nth and n+1 lines from a file once it gets a pattern match. For eg: aaa bbb ccc ddd gh jjjj If I find a match for bbb then I need to print bbb as well as 3rd and 4th line from the match.. Please help..Is it possible to get a command using sed :) (6 Replies)
Discussion started by: saj
6 Replies

7. Shell Programming and Scripting

Sed: printing lines AFTER pattern matching EXCLUDING the line containing the pattern

'Hi I'm using the following code to extract the lines(and redirect them to a txt file) after the pattern match. But the output is inclusive of the line with pattern match. Which option is to be used to exclude the line containing the pattern? sed -n '/Conn.*User/,$p' > consumers.txt (11 Replies)
Discussion started by: essem
11 Replies

8. Shell Programming and Scripting

awk to combine lines from line with pattern match to a line that ends in a pattern

I am trying to combine lines with these conditions: 1. First line starts with text of "libname VALUE db2 datasrc" where VALUE can be any text. 2. If condition1 is met then continue to combine lines through a line that ends with a semicolon. 3. Ignore case when matching patterns and remove any... (5 Replies)
Discussion started by: Wes Kem
5 Replies

9. Shell Programming and Scripting

Need help on pattern matching and printing the same

Hi, I need to match for the pattern '.py' in my file and print the word which contains. For example: cat testfile a b 3 4.py 5 6 a b.py c.py 4 5 6 7 8 1.py 2.py 3 4 5 6 Expected output: 4.py b.py c.py 1.py 2.py (3 Replies)
Discussion started by: Sumanthsv
3 Replies

10. UNIX for Beginners Questions & Answers

Get an output of lines in pattern 1st line then 10th line then 11th line then 20th line and so on.

Input file: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 (6 Replies)
Discussion started by: Sagar Singh
6 Replies
ace-of-penguins(6)						   User Commands						ace-of-penguins(6)

NAME
ace-of_penguins - Solitaire-games with penguin-look SYNOPSIS
ace-canfield ace-freecell ace-golf ace-mastermind ace-merlin ace-minesweeper ace-pegged ace-solitaire ace-spider ace-taipei ace-taipedit ace-thornq OPTIONS
None. DESCRIPTION
From the author's intro.html: "The Ace of Penguins is a set of Unix/X solitaire games based on the ones available for Windows(tm) but with a number of enhancements that make my wife like my versions better :-)" ace-canfield Solitary card-game ace-freecell Solitary card-game ace-spider Solitary card-game ace-solitaire Solitary card-game ace-thornq Solitary card-game ace-golf Another solitary card-game ace-mastermind Guess a secret combination of colors. ace-merlin Classical puzzle, rather frustrating. ace-minesweeper Find all hidden mines in a minefield. ace-pegged Classical board game. ace-taipei Asian puzzle, remove pairs of equal stones. ace-taipedit Editor for your own ace-taipei levels. KEYS
All games use the same library of functions and thus the same keys: F1 Online help. Esc Esc or "Q" to leave the game. NOTES
The upstream author DJ Delorie has written an informative webpage which is installed in /usr/share/doc/ace-of-penguins/intro.html The original binaries were renamed to include prefix ace-* to avoid name clashes. BUGS
If you encounter any bugs in this package, please report them to the Debian Bug Tracking System at http://bugs.debian.org/. ENVIRONMENT
None. FILES
None. SEE ALSO
Other games in /usr/games AUTHORS
Programs are by DJ Delorie, some by Martin Thornquist. This manual page was written 1999-09-09 by Thimo Neubauer <thimo@debian.org> for the Debian GNU system (but may be used by others). Updated 2007-09-03 by Jari Aalto <jari.aalto@cante.net>. Released under license GPL v2 or (at your option) any later version. ace-of-penguins 2012-03-23 ace-of-penguins(6)
All times are GMT -4. The time now is 04:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy