* [gentoo-doc-cvs] cvs commit: l-sed1.xml
@ 2005-07-26 10:46 Jan Kundrat
0 siblings, 0 replies; 5+ messages in thread
From: Jan Kundrat @ 2005-07-26 10:46 UTC (permalink / raw
To: gentoo-doc-cvs
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 23050 bytes --]
jkt 05/07/26 10:46:47
Added: xml/htdocs/doc/en/articles l-sed1.xml l-sed2.xml l-sed3.xml
Log:
#99049, "Common threads: Sed by example", converted by rane
Revision Changes Path
1.1 xml/htdocs/doc/en/articles/l-sed1.xml
file : http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/articles/l-sed1.xml?rev=1.1&content-type=text/x-cvsweb-markup&cvsroot=gentoo
plain: http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/articles/l-sed1.xml?rev=1.1&content-type=text/plain&cvsroot=gentoo
Index: l-sed1.xml
===================================================================
<?xml version='1.0' encoding="UTF-8"?>
<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/articles/l-sed1.xml,v 1.1 2005/07/26 10:46:47 jkt Exp $ -->
<!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
<guide link="/doc/en/articles/l-sed1.xml">
<title>Sed by example, Part 1</title>
<author title="Author">
<mail link="drobbins@gentoo.org">Daniel Robbins</mail>
</author>
<author title="Editor">
<mail link="rane@gentoo.pl">Łukasz Damentko</mail>
</author>
<abstract>
In this series of articles, Daniel Robbins will show you how to use the very
powerful (but often forgotten) UNIX stream editor, sed. Sed is an ideal tool for
batch-editing files or for creating shell scripts to modify existing files in
powerful ways.
</abstract>
<!-- The original version of this article was published on IBM developerWorks,
and is property of Westtech Information Services. This document is an updated
version of the original article, and contains various improvements made by the
Gentoo Linux Documentation team -->
<version>1.0</version>
<date>2005-07-15</date>
<chapter>
<title>Get to know the powerful UNIX editor</title>
<section>
<title>Pick an editor</title>
<body>
<note>
The original version of this article was published on IBM developerWorks, and is
property of Westtech Information Services. This document is an updated version
of the original article, and contains various improvements made by the Gentoo
Linux Documentation team.
</note>
<p>
In the UNIX world, we have a lot of options when it comes to editing files.
Think of it -- vi, emacs, and jed come to mind, as well as many others. We all
have our favorite editor (along with our favorite keybindings) that we have come
to know and love. With our trusty editor, we are ready to tackle any number of
UNIX-related administration or programming tasks with ease.</p>
<p>
While interactive editors are great, they do have limitations. Though their
interactive nature can be a strength, it can also be a weakness. Consider a
situation where you need to perform similar types of changes on a group of
files. You could instinctively fire up your favorite editor and perform a bunch
of mundane, repetitive, and time-consuming edits by hand. But there's a better
way.
</p>
</body>
</section>
<section>
<title>Enter sed</title>
<body>
<p>
It would be nice if we could automate the process of making edits to files, so
that we could "batch" edit files, or even write scripts with the ability to
perform sophisticated changes to existing files. Fortunately for us, for these
types of situations, there is a better way -- and the better way is called sed.
</p>
<p>
sed is a lightweight stream editor that's included with nearly all UNIX flavors,
including Linux. sed has a lot of nice features. First of all, it's very
lightweight, typically many times smaller than your favorite scripting language.
Secondly, because sed is a stream editor, it can perform edits to data it
receives from stdin, such as from a pipeline. So, you don't need to have the
data to be edited stored in a file on disk. Because data can just as easily be
piped to sed, it's very easy to use sed as part of a long, complex pipeline in a
powerful shell script. Try doing that with your favorite editor.
</p>
</body>
</section>
<section>
<title>GNU sed</title>
<body>
<p>
Fortunately for us Linux users, one of the nicest versions of sed out there
happens to be GNU sed, which is currently at version 3.02. Every Linux
distribution has GNU sed, or at least should. GNU sed is popular not only
because its sources are freely distributable, but because it happens to have a
lot of handy, time-saving extensions to the POSIX sed standard. GNU sed also
doesn't suffer from many of the limitations that earlier and proprietary
versions of sed had, such as a limited line length -- GNU sed handles lines of
any length with ease.
</p>
</body>
</section>
<section>
<title>The newest GNU sed</title>
<body>
<p>
While researching this article, I noticed that several online sed aficionados
made reference to a GNU sed 3.02a. Strangely, I couldn't find sed 3.02a on
<uri>ftp://ftp.gnu.org</uri> (see <uri link="#resources">Resources</uri> for
these links), so I had to go look for it elsewhere. I found it at
<uri>ftp://alpha.gnu.org</uri>, in <path>/pub/sed</path>. I happily downloaded
it, compiled it, and installed it, only to find minutes later that the most
recent version of sed is 3.02.80 -- and you can find its sources right next to
those for 3.02a, at <uri>ftp://alpha.gnu.org</uri>. After getting GNU sed
3.02.80 installed, I was finally ready to go.
</p>
</body>
</section>
<section>
<title>The right sed</title>
<body>
<p>
In this series, we will be using GNU sed 3.02.80. Some (but very few) of the
most advanced examples you'll find in my upcoming, follow-on articles in this
series will not work with GNU sed 3.02 or 3.02a. If you're using a non-GNU sed,
your results may vary. Why not take some time to install GNU sed 3.02.80 now?
Then, not only will you be ready for the rest of the series, but you'll also be
able to use arguably the best sed in existence!
</p>
</body>
</section>
<section>
<title>Sed examples</title>
<body>
<p>
Sed works by performing any number of user-specified editing operations
("commands") on the input data. Sed is line-based, so the commands are performed
on each line in order. And, sed writes its results to standard output (stdout);
it doesn't modify any input files.
</p>
<p>
Let's look at some examples. The first several are going to be a bit weird
because I'm using them to illustrate how sed works rather than to perform any
useful task. However, if you're new to sed, it's very important that you
understand them. Here's our first example:
</p>
<pre caption="Example of sed usage">
$ <i>sed -e 'd' /etc/services</i>
</pre>
<p>
If you type this command, you'll get absolutely no output. Now, what happened?
In this example, we called sed with one editing command, <c>d</c>. Sed opened
the <path>/etc/services</path> file, read a line into its pattern buffer,
performed our editing command ("delete line"), and then printed the pattern
buffer (which was empty). It then repeated these steps for each successive line.
This produced no output, because the <c>d</c> command zapped every single line
in the pattern buffer!
</p>
<p>
There are a couple of things to notice in this example. First,
<path>/etc/services</path> was not modified at all. This is because, again, sed
only reads from the file you specify on the command line, using it as input --
it doesn't try to modify the file. The second thing to notice is that sed is
line-oriented. The <c>d</c> command didn't simply tell sed to delete all incoming
data in one fell swoop. Instead, sed read each line of /etc/services one by one
into its internal buffer, called the pattern buffer. Once a line was read into
the pattern buffer, it performed the <c>d</c> command and printed the contents
of the pattern buffer (nothing in this example). Later, I'll show you how to use
address ranges to control which lines a command is applied to -- but in the
absence of addresses, a command is applied to all lines.
</p>
<p>
The third thing to notice is the use of single quotes to surround the <c>d</c>
command. It's a good idea to get into the habit of using single quotes to
surround your sed commands, so that shell expansion is disabled.
</p>
</body>
</section>
<section>
<title>Another sed example</title>
<body>
<p>
Here's an example of how to use sed to remove the first line of the
<path>/etc/services</path> file from our output stream:
</p>
<pre caption="Another sed example">
$ <i>sed -e '1d' /etc/services | more</i>
1.1 xml/htdocs/doc/en/articles/l-sed2.xml
file : http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/articles/l-sed2.xml?rev=1.1&content-type=text/x-cvsweb-markup&cvsroot=gentoo
plain: http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/articles/l-sed2.xml?rev=1.1&content-type=text/plain&cvsroot=gentoo
Index: l-sed2.xml
===================================================================
<?xml version='1.0' encoding="UTF-8"?>
<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/articles/l-sed2.xml,v 1.1 2005/07/26 10:46:47 jkt Exp $ -->
<!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
<guide link="/doc/en/articles/l-sed2.xml">
<title>Sed by example, Part 2</title>
<author title="Author">
<mail link="drobbins@gentoo.org">Daniel Robbins</mail>
</author>
<author title="Editor">
<mail link="rane@gentoo.pl">Łukasz Damentko</mail>
</author>
<abstract>
Sed is a very powerful and compact text stream editor. In this article, the
second in the series, Daniel shows you how to use sed to perform string
substitution; create larger sed scripts; and use sed's append, insert, and
change line commands.
</abstract>
<!-- The original version of this article was published on IBM developerWorks,
and is property of Westtech Information Services. This document is an updated
version of the original article, and contains various improvements made by the
Gentoo Linux Documentation team -->
<version>1.0</version>
<date>2005-07-15</date>
<chapter>
<title>How to further take advantage of the UNIX text editor</title>
<section>
<title>Substitution!</title>
<body>
<note>
The original version of this article was published on IBM developerWorks, and is
property of Westtech Information Services. This document is an updated version
of the original article, and contains various improvements made by the Gentoo
Linux Documentation team.
</note>
<p>
Let's look at one of sed's most useful commands, the substitution command.
Using it, we can replace a particular string or matched regular expression with
another string. Here's an example of the most basic use of this command:
</p>
<pre caption="Most basic use of substitution command">
$ <i>sed -e 's/foo/bar/' myfile.txt</i>
</pre>
<p>
The above command will output the contents of myfile.txt to stdout, with the
first occurrence of 'foo' (if any) on each line replaced with the string 'bar'.
Please note that I said first occurrence on each line, though this is normally
not what you want. Normally, when I do a string replacement, I want to perform
it globally. That is, I want to replace all occurrences on every line, as
follows:
</p>
<pre caption="Replacing all the occurences on every line">
$ <i>sed -e 's/foo/bar/g' myfile.txt</i>
</pre>
<p>
The additional 'g' option after the last slash tells sed to perform a global
replace.
</p>
<p>
Here are a few other things you should know about the <c>s///</c> substitution
command. First, it is a command, and a command only; there are no addresses
specified in any of the above examples. This means that the <c>s///</c> command
can also be used with addresses to control what lines it will be applied to, as
follows:
</p>
<pre caption="Specifying lines command will be applied to">
$ <i>sed -e '1,10s/enchantment/entrapment/g' myfile2.txt</i>
</pre>
<p>
The above example will cause all occurrences of the phrase 'enchantment' to be
replaced with the phrase 'entrapment', but only on lines one through ten,
inclusive.
</p>
<pre caption="Specifying more options">
$ <i>sed -e '/^$/,/^END/s/hills/mountains/g' myfile3.txt</i>
</pre>
<p>
This example will swap 'hills' for 'mountains', but only on blocks of text
beginning with a blank line, and ending with a line beginning with the three
characters 'END', inclusive.
</p>
<p>
Another nice thing about the <c>s///</c> command is that we have a lot of
options when it comes to those <c>/</c> separators. If we're performing string
substitution and the regular expression or replacement string has a lot of
slashes in it, we can change the separator by specifying a different character
after the 's'. For example, this will replace all occurrences of
<path>/usr/local</path> with <path>/usr</path>:
</p>
<pre caption="Replacing all the occurences of one string with another one">
$ <i>sed -e 's:/usr/local:/usr:g' mylist.txt</i>
</pre>
<note>
In this example, we're using the colon as a separator. If you ever need to
specify the separator character in the regular expression, put a backslash
before it.
</note>
</body>
</section>
<section>
<title>Regexp snafus</title>
<body>
<p>
Up until now, we've only performed simple string substitution. While this is
handy, we can also match a regular expression. For example, the following sed
command will match a phrase beginning with '<' and ending with '>', and
containing any number of characters inbetween. This phrase will be deleted
(replaced with an empty string):
</p>
<pre caption="Deleting specified phrase">
$ <i>sed -e 's/<.*>//g' myfile.html</i>
</pre>
<p>
This is a good first attempt at a sed script that will remove HTML tags from a
file, but it won't work well, due to a regular expression quirk. The reason?
When sed tries to match the regular expression on a line, it finds the longest
match on the line. This wasn't an issue in my previous sed article, because we
were using the <c>d</c> and <c>p</c> commands, which would delete or print the
entire line anyway. But when we use the <c>s///</c> command, it definitely makes
a big difference, because the entire portion that the regular expression matches
will be replaced with the target string, or in this case, deleted. This means
that the above example will turn the following line:
</p>
<pre caption="Sample HTML code">
<b>This</b> is what <b>I</b> meant.
</pre>
<p>
Into this:
</p>
<pre caption="Not desired effect">
meant.
</pre>
<p>
Rather than this, which is what we wanted to do:
</p>
<pre caption="Desired effect">
This is what I meant.
</pre>
<p>
Fortunately, there is an easy way to fix this. Instead of typing in a regular
expression that says "a '<' character followed by any number of characters, and
ending with a '>' character", we just need to type in a regexp that says "a
'<' character followed by any number of non-'>' characters, and ending
with a '>' character". This will have the effect of matching the shortest
possible match, rather than the longest possible one. The new command looks like
this:
</p>
<pre caption="">
$ <i>sed -e 's/<[^>]*>//g' myfile.html</i>
</pre>
<p>
In the above example, the '[^>]' specifies a "non-'>'" character, and the '*'
after it completes this expression to mean "zero or more non-'>' characters".
Test this command on a few sample html files, pipe them to more, and review
their results.
</p>
</body>
</section>
<section>
<title>More character matching</title>
<body>
<p>
The '[ ]' regular expression syntax has some more additional options. To specify
a range of characters, you can use a '-' as long as it isn't in the first or
last position, as follows:
1.1 xml/htdocs/doc/en/articles/l-sed3.xml
file : http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/articles/l-sed3.xml?rev=1.1&content-type=text/x-cvsweb-markup&cvsroot=gentoo
plain: http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/articles/l-sed3.xml?rev=1.1&content-type=text/plain&cvsroot=gentoo
Index: l-sed3.xml
===================================================================
<?xml version='1.0' encoding="UTF-8"?>
<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/articles/l-sed3.xml,v 1.1 2005/07/26 10:46:47 jkt Exp $ -->
<!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
<guide link="/doc/en/articles/l-sed3.xml">
<title>Sed by example, Part 3</title>
<author title="Author">
<mail link="drobbins@gentoo.org">Daniel Robbins</mail>
</author>
<author title="Editor">
<mail link="rane@gentoo.pl">Łukasz Damentko</mail>
</author>
<abstract>
Sed is a very powerful and compact text stream editor. In this article, the
second in the series, Daniel shows you how to use sed to perform string
substitution; create larger sed scripts; and use sed's append, insert, and
change line commands.
</abstract>
<!-- The original version of this article was published on IBM developerWorks,
and is property of Westtech Information Services. This document is an updated
version of the original article, and contains various improvements made by the
Gentoo Linux Documentation team -->
<version>1.0</version>
<date>2005-07-16</date>
<chapter>
<title>Taking it to the next level: Data crunching, sed style</title>
<section>
<title>Muscular sed</title>
<body>
<note>
The original version of this article was published on IBM developerWorks, and is
property of Westtech Information Services. This document is an updated version
of the original article, and contains various improvements made by the Gentoo
Linux Documentation team.
</note>
<p>
In <uri link="l-sed2.xml">my second sed article</uri>, I
offered examples that demonstrated how sed works, but very few of these examples
actually did anything particularly useful. In this final sed article, it's time
to change that pattern and put sed to good use. I'll show you several excellent
examples that not only demonstrate the power of sed, but also do some really
neat (and handy) things. For example, in the second half of the article, I'll
show you how I designed a sed script that converts a .QIF file from Intuit's
Quicken financial program into a nicely formatted text file. Before doing that,
we'll take a look at some less complicated yet useful sed scripts.
</p>
</body>
</section>
<section>
<title>Text translation</title>
<body>
<p>
Our first practical script converts UNIX-style text to DOS/Windows format. As
you probably know, DOS/Windows-based text files have a CR (carriage return) and
LF (line feed) at the end of each line, while UNIX text has only a line feed.
There may be times when you need to move some UNIX text to a Windows system, and
this script will perform the necessary format conversion for you.
</p>
<pre caption="Format conversion between UNIX and Windows">
$ <i>sed -e 's/$/\r/' myunix.txt > mydos.txt</i>
</pre>
<p>
In this script, the '$' regular expression will match the end of the line, and
the '\r' tells sed to insert a carriage return right before it. Insert a
carriage return before a line feed, and presto, a CR/LF ends each line. Please
note that the '\r' will be replaced with a CR only when using GNU sed 3.02.80 or
later. If you haven't installed GNU sed 3.02.80 yet, see <uri
link="l-sed1.xml">my first sed article</uri> for instructions on
how to do this.
</p>
<p>
I can't tell you how many times I've downloaded some example script or C code,
only to find that it's in DOS/Windows format. While many programs don't mind
DOS/Windows format CR/LF text files, several programs definitely do -- the most
notable being bash, which chokes as soon as it encounters a carriage return. The
following sed invocation will convert DOS/Windows format text to trusty UNIX
format:
</p>
<pre caption="Converting C code from Windows to UNIX format">
$ <i>sed -e 's/.$//' mydos.txt > myunix.txt</i>
</pre>
<p>
The way this script works is simple: our substitution regular expression matches
the last character on the line, which happens to be a carriage return. We
replace it with nothing, causing it to be deleted from the output entirely. If
you use this script and notice that the last character of every line of the
output has been deleted, you've specified a text file that's already in UNIX
format. No need for that!
</p>
</body>
</section>
<section>
<title>Reversing lines</title>
<body>
<p>
Here's another handy little script. This one will reverse lines in a file,
similar to the "tac" command that's included with most Linux distributions. The
name "tac" may be a bit misleading, because "tac" doesn't reverse the position
of characters on the line (left and right), but rather the position of lines in
the file (up and down). Tacing the following file:
</p>
<pre caption="Sample file">
foo
bar
oni
</pre>
<p>
....produces the following output:
</p>
<pre caption="Output file">
oni
bar
foo
</pre>
<p>
We can do the same thing with the following sed script:
</p>
<pre caption="Doing same with script">
$ <i>sed -e '1!G;h;$!d' forward.txt > backward.txt</i>
</pre>
<p>
You'll find this sed script useful if you're logged in to a FreeBSD system,
which doesn't happen to have a "tac" command. While handy, it's also a good idea
to know why this script does what it does. Let's dissect it.
</p>
</body>
</section>
<section>
<title>Reversal explained</title>
<body>
<p>
First, this script contains three separate sed commands, separated by
semicolons: '1!G', 'h' and '$!d'. Now, it's time to get an good understanding of
the addresses used for the first and third commands. If the first command were
'1G', the 'G' command would be applied only to the first line. However, there is
an additional '!' character -- this '!' character negates the address, meaning
that the 'G' command will apply to all but the first line. For the '$!d'
command, we have a similar situation. If the command were '$d', it would apply
the 'd' command to only the last line in the file (the '$' address is a simple
way of specifying the last line). However, with the '!', '$!d' will apply the
'd' command to all but the last line. Now, all we need to to is understand what
the commands themselves do.
</p>
<p>
When we execute our line reversal script on the text file above, the first
command that gets executed is 'h'. This command tells sed to copy the contents
of the pattern space (the buffer that holds the current line being worked on) to
the hold space (a temporary buffer). Then, the 'd' command is executed, which
deletes "foo" from the pattern space, so it doesn't get printed after all the
commands are executed for this line.
</p>
<p>
Now, line two. After "bar" is read into the pattern space, the 'G' command is
executed, which appends the contents of the hold space ("foo\n") to the pattern
space ("bar\n"), resulting in "bar\n\foo\n" in our pattern space. The 'h'
command puts this back in the hold space for safekeeping, and 'd' deletes the
line from the pattern space so that it isn't printed.
</p>
<p>
For the last "oni" line, the same steps are repeated, except that the contents
of the pattern space aren't deleted (due to the '$!' before the 'd'), and the
contents of the pattern space (three lines) are printed to stdout.
</p>
<p>
Now, it's time to do some powerful data conversion with sed.
</p>
</body>
</section>
<section>
<title>sed QIF magic</title>
--
gentoo-doc-cvs@gentoo.org mailing list
^ permalink raw reply [flat|nested] 5+ messages in thread
* [gentoo-doc-cvs] cvs commit: l-sed1.xml
@ 2005-08-15 21:00 Camille Huot
0 siblings, 0 replies; 5+ messages in thread
From: Camille Huot @ 2005-08-15 21:00 UTC (permalink / raw
To: gentoo-doc-cvs
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1594 bytes --]
cam 05/08/15 21:00:31
Modified: xml/htdocs/doc/en/articles l-sed1.xml
Log:
s/rane@gentoo.pl/rane@gentoo.org/
Revision Changes Path
1.2 +2 -2 xml/htdocs/doc/en/articles/l-sed1.xml
file : http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/articles/l-sed1.xml?rev=1.2&content-type=text/x-cvsweb-markup&cvsroot=gentoo
plain: http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/articles/l-sed1.xml?rev=1.2&content-type=text/plain&cvsroot=gentoo
diff : http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/articles/l-sed1.xml.diff?r1=1.1&r2=1.2&cvsroot=gentoo
Index: l-sed1.xml
===================================================================
RCS file: /var/cvsroot/gentoo/xml/htdocs/doc/en/articles/l-sed1.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- l-sed1.xml 26 Jul 2005 10:46:47 -0000 1.1
+++ l-sed1.xml 15 Aug 2005 21:00:31 -0000 1.2
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding="UTF-8"?>
-<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/articles/l-sed1.xml,v 1.1 2005/07/26 10:46:47 jkt Exp $ -->
+<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/articles/l-sed1.xml,v 1.2 2005/08/15 21:00:31 cam Exp $ -->
<!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
<guide link="/doc/en/articles/l-sed1.xml">
@@ -9,7 +9,7 @@
<mail link="drobbins@gentoo.org">Daniel Robbins</mail>
</author>
<author title="Editor">
- <mail link="rane@gentoo.pl">Łukasz Damentko</mail>
+ <mail link="rane@gentoo.org">Łukasz Damentko</mail>
</author>
<abstract>
--
gentoo-doc-cvs@gentoo.org mailing list
^ permalink raw reply [flat|nested] 5+ messages in thread
* [gentoo-doc-cvs] cvs commit: l-sed1.xml
@ 2005-09-11 21:23 Lukasz Damentko
0 siblings, 0 replies; 5+ messages in thread
From: Lukasz Damentko @ 2005-09-11 21:23 UTC (permalink / raw
To: gentoo-doc-cvs
rane 05/09/11 21:23:49
Modified: xml/htdocs/doc/en/articles l-sed1.xml
Log:
fixed typo, thanks to keidii for reporting
Revision Changes Path
1.4 +2 -2 xml/htdocs/doc/en/articles/l-sed1.xml
file : http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/articles/l-sed1.xml?rev=1.4&content-type=text/x-cvsweb-markup&cvsroot=gentoo
plain: http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/articles/l-sed1.xml?rev=1.4&content-type=text/plain&cvsroot=gentoo
diff : http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/articles/l-sed1.xml.diff?r1=1.3&r2=1.4&cvsroot=gentoo
Index: l-sed1.xml
===================================================================
RCS file: /var/cvsroot/gentoo/xml/htdocs/doc/en/articles/l-sed1.xml,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- l-sed1.xml 10 Sep 2005 21:20:16 -0000 1.3
+++ l-sed1.xml 11 Sep 2005 21:23:49 -0000 1.4
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding="UTF-8"?>
-<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/articles/l-sed1.xml,v 1.3 2005/09/10 21:20:16 rane Exp $ -->
+<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/articles/l-sed1.xml,v 1.4 2005/09/11 21:23:49 rane Exp $ -->
<!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
<guide link="/doc/en/articles/l-sed1.xml">
@@ -440,7 +440,7 @@
</p>
<p>
-OK, now on to the second regexp. '/^}' will match a '}' character that appears
+OK, now on to the second regexp. '/^}/' will match a '}' character that appears
at the beginning of a new line. If your code is formatted nicely, this will
match the closing brace of your main() function. If it's not, it won't -- one of
the tricky things about performing pattern matching.
--
gentoo-doc-cvs@gentoo.org mailing list
^ permalink raw reply [flat|nested] 5+ messages in thread
* [gentoo-doc-cvs] cvs commit: l-sed1.xml
@ 2005-09-11 21:29 Lukasz Damentko
0 siblings, 0 replies; 5+ messages in thread
From: Lukasz Damentko @ 2005-09-11 21:29 UTC (permalink / raw
To: gentoo-doc-cvs
rane 05/09/11 21:29:58
Modified: xml/htdocs/doc/en/articles l-sed1.xml
Log:
version bump, stab, stab, stab, stake, stake, stab
Revision Changes Path
1.5 +2 -2 xml/htdocs/doc/en/articles/l-sed1.xml
file : http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/articles/l-sed1.xml?rev=1.5&content-type=text/x-cvsweb-markup&cvsroot=gentoo
plain: http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/articles/l-sed1.xml?rev=1.5&content-type=text/plain&cvsroot=gentoo
diff : http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/articles/l-sed1.xml.diff?r1=1.4&r2=1.5&cvsroot=gentoo
Index: l-sed1.xml
===================================================================
RCS file: /var/cvsroot/gentoo/xml/htdocs/doc/en/articles/l-sed1.xml,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- l-sed1.xml 11 Sep 2005 21:23:49 -0000 1.4
+++ l-sed1.xml 11 Sep 2005 21:29:58 -0000 1.5
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding="UTF-8"?>
-<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/articles/l-sed1.xml,v 1.4 2005/09/11 21:23:49 rane Exp $ -->
+<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/articles/l-sed1.xml,v 1.5 2005/09/11 21:29:58 rane Exp $ -->
<!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
<guide link="/doc/en/articles/l-sed1.xml">
@@ -21,7 +21,7 @@
version of the original article, and contains various improvements made by the
Gentoo Linux Documentation team -->
-<version>1.1</version>
+<version>1.2</version>
<date>2005-07-15</date>
<chapter>
--
gentoo-doc-cvs@gentoo.org mailing list
^ permalink raw reply [flat|nested] 5+ messages in thread
* [gentoo-doc-cvs] cvs commit: l-sed1.xml
@ 2006-09-25 10:19 Xavier Neys
0 siblings, 0 replies; 5+ messages in thread
From: Xavier Neys @ 2006-09-25 10:19 UTC (permalink / raw
To: gentoo-doc-cvs
neysx 06/09/25 10:19:07
Modified: l-sed1.xml
Log:
Commented out a dead link, reported by Miguel
Revision Changes Path
1.7 xml/htdocs/doc/en/articles/l-sed1.xml
file : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/en/articles/l-sed1.xml?rev=1.7&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/en/articles/l-sed1.xml?rev=1.7&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/en/articles/l-sed1.xml?r1=1.6&r2=1.7
Index: l-sed1.xml
===================================================================
RCS file: /var/cvsroot/gentoo/xml/htdocs/doc/en/articles/l-sed1.xml,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- l-sed1.xml 9 Oct 2005 17:13:23 -0000 1.6
+++ l-sed1.xml 25 Sep 2006 10:19:07 -0000 1.7
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding="UTF-8"?>
-<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/articles/l-sed1.xml,v 1.6 2005/10/09 17:13:23 rane Exp $ -->
+<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/articles/l-sed1.xml,v 1.7 2006/09/25 10:19:07 neysx Exp $ -->
<!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
<guide link="/doc/en/articles/l-sed1.xml" disclaimer="articles">
@@ -21,7 +21,7 @@
version of the original article, and contains various improvements made by the
Gentoo Linux Documentation team -->
-<version>1.3</version>
+<version>1.4</version>
<date>2005-10-09</date>
<chapter>
@@ -513,11 +513,13 @@
link="http://www-106.ibm.com/developerworks/linux/library/l-python5.html">Text
processing in Python</uri> on developerWorks.
</li>
+<!-- Dead link
<li>
Brush up on <uri link="http://vision.eng.shu.ac.uk/C++/misc/regexp/">using
regular expressions</uri> to find and modify patterns in text in this free,
dW-exclusive tutorial.
</li>
+-->
<li>
See the regular expressions <uri
link="http://www.python.org/doc/howto/regex/regex.html">how-to
--
gentoo-doc-cvs@gentoo.org mailing list
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-09-25 10:19 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-26 10:46 [gentoo-doc-cvs] cvs commit: l-sed1.xml Jan Kundrat
-- strict thread matches above, loose matches on Subject: below --
2005-08-15 21:00 Camille Huot
2005-09-11 21:23 Lukasz Damentko
2005-09-11 21:29 Lukasz Damentko
2006-09-25 10:19 Xavier Neys
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox