06-08-2009
You can put the line numbers ranges before appending the lines.
ex:
sed '1,8 ....do somthing'
BR
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi all,
I am using sed for extracting the lines that occurs between the 2 patterns using the following command:
sed -n '/pattern1/,/pattern2/' filename
The above command has no problem and works fine. But I was wondering if there is a way to quit sed when it has extracted the range at... (3 Replies)
Discussion started by: sank
3 Replies
2. Shell Programming and Scripting
OK, so for a grand overview of what I'm trying to do:
I've got 2 files that are mostly like.
The file format is:
data
data
data
data
data
data
data
data
data
data (2 Replies)
Discussion started by: Wrathe
2 Replies
3. Shell Programming and Scripting
Hi,
I am trying to get all the log entries in a log file based on start and end times,
I have tried to use the following but couldnt get the desired output:
sed -n '/start/,/end/ p' file
&
newtime=`echo "$time" | cut -d -start | cut -d" " -start`
Kindly help me,
Thanks (0 Replies)
Discussion started by: openspark
0 Replies
4. UNIX Desktop Questions & Answers
I want to setup dual monitor for the Dell Optiplex Gx520 computer.
The motherboard has an Intel Corporation 82915G Integrated Graphics
Controller.
Then I add an ATI Rage 128 video card.
The dual monitor work on Windows 2000 with the Intel chip as the
primary screen and the ATI chip... (0 Replies)
Discussion started by: TsanChung
0 Replies
5. Shell Programming and Scripting
Hi guys, trying to replace a '#' with a ' ' (space) but only between the brackets '(' and ')'
N="text1#text2#text3(var1#var2#var3)"
N=`echo $N |sed '/(/,/) s/#. //'`
echo $N
Looking for an output of "text1#text2#text3(var1 var2 var3)"
Any ideas? (15 Replies)
Discussion started by: mikepegg
15 Replies
6. Shell Programming and Scripting
So here is my problem:
I need to do a sed search and replace on the following:
variable_blah_STATUS replaced with "replace string".
sed 's/variable_blah_STATUS/replace string/g' works great but there is a catch.
The catch is that I need to check and not replace variable_blah_STATUS... (3 Replies)
Discussion started by: phreezr
3 Replies
7. Shell Programming and Scripting
Hi all,
Is there a way to use the sed command to get the second range?
For instance:
sample.dat:
-------------
11111
22222
33333
44444
-------------
using "sed -n '/^ping/,/^$/p' sample.dat can get the first 2 lines.
But is there a way to get the first 4 lines, from... (4 Replies)
Discussion started by: sleepy_11
4 Replies
8. Shell Programming and Scripting
Hi
I would like to delete ranges of text from an html file;
In the sentence; aqua>Stroomprobleem in Hengelo verholpen <a href="107-01.html"><font color=yellow>107</a>
With several sentences like this in that file, where the text between <a href a> varies, so it needs to be deleted in the... (2 Replies)
Discussion started by: mdop
2 Replies
9. Shell Programming and Scripting
Hi,
I am trying to grep out a date range in an access log file. I defined the date like so;
DATE1=$(date --date '1 hour ago' '+%m/%d/%y:%H:%M:%S')
DATE2=$(date '+%m/%d/%y:%H:%M:%S')
Then I just used cat to get the hits to the url into a results.txt;
touch /tmp/results.txt
cat... (7 Replies)
Discussion started by: Epx998
7 Replies
10. UNIX for Dummies Questions & Answers
Trying to use SED to replace numbers that fall into a range but can't seem to get the logic to work and am wondering if SED will do this. I have a file with the following numbers
3
26
20
5. For the numbers that are greater than zero and less than 25, SED would add the word range after the... (7 Replies)
Discussion started by: jimmyf
7 Replies
LEARN ABOUT DEBIAN
lurker-search
LURKER-SEARCH(1) General Commands Manual LURKER-SEARCH(1)
NAME
lurker-search -- searches for messages in a lurker database
SYNOPSIS
lurker-search [-c <config-file>] [-k <keyword>] [-d -f -i -v -q] [<terms>*]
DESCRIPTION
lurker-search searches a lurker database the same way as the web interface. It can output summary information and delete messages.
OPTIONS
-c config-file
Use this config file for lurker settings.
-k keyword
Tag the matching messages with this keyword.
-d Delete the messages found by this search
-f Don't prompt before deleting
-i Command line paramers are not search terms, but message IDs.
-v Output message summary information
-q Don't output message ids or status
SEARCH TERMS
Lurker-search accepts these keywords for searching:
-xxx select messages which do NOT match this term
id:xxx select a message by the Message-ID field
rt:xxx select messages which reply to the chosen Message-ID
th:xxx select messages included in this thread
ml:xxx select messages in this mailing list
gr:xxx select messages in this mailing list group
au:xxx select messages with this term in the author fields
sb:xxx select messages with this word in the subject
lang:xxx select messages in this language
SEE ALSO
lurker-index(1), lurker-prune(1), lurker-params(1), lurker-list(1)
lurker documentation on http://lurker.sourceforge.net/
COPYRIGHT
Copyright (C) 2002: Wesley W. Terpstra <terpstra@users.sourceforge.net>
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MER-
CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
BUGS
Before reporting a bug, please confirm that the bug you found is still present in the latest official release. If the problem persists,
then send mail with instructions describing how to reproduce the bug to <lurker-users@lists.sourceforge.net>.
LURKER-SEARCH(1)