From de400b3b343a42806147dbcb1482018161adf0a8 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Mon, 30 Jan 2006 07:28:33 +0000 Subject: [PATCH] fix `turn filenames into lowercase' example git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-60 --- THANKS | 2 +- doc/sed-in.texi | 16 ++++++++++------ doc/sed.texi | 23 +++++++++++++++-------- 3 files changed, 26 insertions(+), 15 deletions(-) diff --git a/THANKS b/THANKS index db42f33..c8a8a32 100644 --- a/THANKS +++ b/THANKS @@ -13,7 +13,7 @@ Dietrich Kappe Doug McIlroy Eero Hakkinen Eli Zaretskii -Eric Pement +Eric Pement Erick Branderhorst Francois Pinard Gaumond Pierre diff --git a/doc/sed-in.texi b/doc/sed-in.texi index 56ad59f..3becf31 100644 --- a/doc/sed-in.texi +++ b/doc/sed-in.texi @@ -1805,7 +1805,7 @@ G # now, transform path/fromfile\n, into # mv path/fromfile path/tofile and print it -s/^\(.*\/\)\(.*\)\n\(.*\)$/mv \1\2 \1\3/p +s/^\(.*\/\)\(.*\)\n\(.*\)$/mv "\1\2" "\1\3"/p ' | $apply_cmd @end example @@ -2055,9 +2055,9 @@ even more complicated to contrive than this script). The approach is to map numbers to letters, kind of an abacus implemented with @command{sed}. @samp{a}s are units, @samp{b}s are -tenths and so on: we simply add the number of characters +tens and so on: we simply add the number of characters on the current line as units, and then propagate the carry -to tenths, hundredths, and so on. +to tens, hundreds, and so on. As usual, running totals are kept in hold space. @@ -2066,7 +2066,7 @@ For the sake of variety, this is done with a loop rather than with some 80 @code{s} commands@footnote{Some implementations have a limit of 199 commands per script}: first we convert units, removing @samp{a}s from the number; then we -rotate letters so that tenths become @samp{a}s, and so on +rotate letters so that tens become @samp{a}s, and so on until no more letters remain. @c start------------------------------------------- @@ -2258,6 +2258,10 @@ D @end example @c end--------------------------------------------- +Note how the first, second and fourth line are inactive after +the first ten lines of input. After that, all the script does +is: exiting on the last line of input, appending the next input +line to pattern space, and removing the first line. @node uniq @section Make Duplicate Lines Unique @@ -2420,8 +2424,8 @@ tx This removes leading and trailing blank lines. It is also the fastest. Note that loops are completely done with @code{n} and -@code{b}, without exploting the fact that @command{sed} cycles back -to the top of the script automatically at the end of a line. +@code{b}, without relying on @command{sed} to restart the +the script automatically at the end of a line. @c start------------------------------------------- @example diff --git a/doc/sed.texi b/doc/sed.texi index 2e023b7..02d80d6 100644 --- a/doc/sed.texi +++ b/doc/sed.texi @@ -1861,7 +1861,7 @@ G @group # now, transform path/fromfile\n, into # mv path/fromfile path/tofile and print it -s/^\(.*\/\)\(.*\)\n\(.*\)$/mv \1\2 \1\3/p +s/^\(.*\/\)\(.*\)\n\(.*\)$/mv "\1\2" "\1\3"/p @end group ' | $apply_cmd @@ -2158,9 +2158,9 @@ even more complicated to contrive than this script). The approach is to map numbers to letters, kind of an abacus implemented with @command{sed}. @samp{a}s are units, @samp{b}s are -tenths and so on: we simply add the number of characters +tens and so on: we simply add the number of characters on the current line as units, and then propagate the carry -to tenths, hundredths, and so on. +to tens, hundreds, and so on. As usual, running totals are kept in hold space. @@ -2169,7 +2169,7 @@ For the sake of variety, this is done with a loop rather than with some 80 @code{s} commands@footnote{Some implementations have a limit of 199 commands per script}: first we convert units, removing @samp{a}s from the number; then we -rotate letters so that tenths become @samp{a}s, and so on +rotate letters so that tens become @samp{a}s, and so on until no more letters remain. @c start------------------------------------------- @@ -2385,6 +2385,10 @@ D @end example @c end--------------------------------------------- +Note how the first, second and fourth line are inactive after +the first ten lines of input. After that, all the script does +is: exiting on the last line of input, appending the next input +line to pattern space, and removing the first line. @node uniq @section Make Duplicate Lines Unique @@ -2579,8 +2583,8 @@ tx This removes leading and trailing blank lines. It is also the fastest. Note that loops are completely done with @code{n} and -@code{b}, without exploting the fact that @command{sed} cycles back -to the top of the script automatically at the end of a line. +@code{b}, without relying on @command{sed} to restart the +the script automatically at the end of a line. @c start------------------------------------------- @example @@ -2725,8 +2729,11 @@ In addition to several books that have been written about @command{sed} (either specifically or as chapters in books which discuss shell programming), one can find out more about @command{sed} (including suggestions of a few books) from the FAQ -for the @code{sed-users} mailing list, available from -@uref{http://sed.sf.net/grabbag/tutorials/sedfaq.txt}. +for the @code{sed-users} mailing list, available from any of: +@display + @uref{http://www.student.northpark.edu/pemente/sed/sedfaq.html} + @uref{http://sed.sf.net/grabbag/tutorials/sedfaq.html} +@end display Also of interest are @uref{http://www.student.northpark.edu/pemente/sed/index.htm}