diff options
Diffstat (limited to 'doc/sed-in.texi')
-rw-r--r-- | doc/sed-in.texi | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/doc/sed-in.texi b/doc/sed-in.texi index 1ed602f..772a138 100644 --- a/doc/sed-in.texi +++ b/doc/sed-in.texi @@ -4,7 +4,7 @@ @c (nothing!) @c -------------------------------------------------------------------------- @c Check for consistency: regexps in @code, text that they match in @samp. -@c +@c @c Tips: @c @command for command @c @samp for command fragments: @samp{cat -s} @@ -730,19 +730,19 @@ Matches between @var{i} and @var{j}, inclusive, sequences. Matches more than or equal to @var{i} sequences. @item \(@var{regexp}\) -Groups the inner @var{regexp} as a whole, this is used to: +Groups the inner @var{regexp} as a whole, this is used to: @itemize @bullet @item @cindex @acronym{GNU} extensions, to basic regular expressions Apply postfix operators, like @code{\(abcd\)*}: -this will search for zero or more whole sequences +this will search for zero or more whole sequences of @samp{abcd}, while @code{abcd*} would search for @samp{abc} followed by zero or more occurrences of @samp{d}. Note that support for @code{\(abcd\)*} is required by @acronym{POSIX} 1003.1-2001, but many non-@acronym{GNU} implementations do not support it and hence it is not universally -portable. +portable. @item Use back references (see below). @@ -852,7 +852,7 @@ Matches @samp{abcdef}. @item a*b Matches zero or more @samp{a}s followed by a single -@samp{b}. For example, @samp{b} or @samp{aaaaab}. +@samp{b}. For example, @samp{b} or @samp{aaaaab}. @item a\?b Matches @samp{b} or @samp{ab}. @@ -1825,7 +1825,7 @@ seen a script converting the output of @command{date} into a @command{bc} program! The main body of this is the @command{sed} script, which remaps the name -from lower to upper (or vice-versa) and even checks out +from lower to upper (or vice-versa) and even checks out if the remapped name is the same as the original name. Note how the script is parameterized using shell variables and proper quoting. @@ -1833,11 +1833,11 @@ variables and proper quoting. @c start------------------------------------------- @example #! /bin/sh -# rename files to lower/upper case... +# rename files to lower/upper case... # -# usage: -# move-to-lower * -# move-to-upper * +# usage: +# move-to-lower * +# move-to-upper * # or # move-to-lower -R . # move-to-upper -R . @@ -1868,7 +1868,7 @@ files_only= while : do - case "$1" in + case "$1" in -n) apply_cmd='cat' ;; -R) finder='find "$@@" -type f';; -h) help ; exit 1 ;; @@ -2559,7 +2559,7 @@ the script automatically at the end of a line. p # get next n -# got chars? print it again, etc... +# got chars? print it again, etc... /./bx # no, don't have chars: got an empty line @@ -2707,7 +2707,7 @@ Please do not send a bug report like this: @example @i{@i{@r{while building frobme-1.3.4}}} -$ configure +$ configure @error{} sed: file sedscr line 1: Unknown option to 's' @end example @@ -2943,7 +2943,7 @@ Summarizing, we have: A backslash can introduce several special sequences @item -The circumflex, dollar sign, and period characters behave specially +The circumflex, dollar sign, and period characters behave specially with regard to new lines @item @@ -3010,7 +3010,7 @@ group. @appendixsec Backslash @cindex Perl-style regular expressions, escaped sequences -There are a few difference in the handling of backslashed +There are a few difference in the handling of backslashed sequences in Perl mode. First of all, there are no @code{\o} and @code{\d} sequences. @@ -3058,8 +3058,8 @@ stand for themselves. For example: Note that octal values of 100 or greater must not be introduced by a leading zero, because no more than three octal -digits are ever read. Note that this applies only to the LHS -pattern; it is not possible yet to specify more than 9 backreferences +digits are ever read. Note that this applies only to the LHS +pattern; it is not possible yet to specify more than 9 backreferences on the RHS of the `s' command. All the sequences that define a single byte value can be @@ -3717,8 +3717,8 @@ reference. If the @code{X} modifier option is set, this can be whitespace. Otherwise an empty comment can be used, or the following character can be expressed in hexadecimal or octal. Note that this applies only to the LHS pattern; it is -not possible yet to specify more than 9 backreferences on the -RHS of the `s' command. +not possible yet to specify more than 9 backreferences on the +RHS of the `s' command. A back reference that occurs inside the parentheses to which it refers fails when the subpattern is first used, so, for @@ -3867,7 +3867,7 @@ This time the first assertion looks at the preceding six characters, checking that the first three are digits, and then the second assertion checks that the preceding three characters are not @samp{999}. Actually, assertions can be -nested in any combination, so one can write this as +nested in any combination, so one can write this as @example (?<=\d@{3@}(?!999)...)foo @@ -4089,7 +4089,7 @@ The condition is a positive lookahead assertion that matches a letter that is three characters away from the current point. If a letter is found, the subject is matched against the first alternative @samp{@var{dd}-@var{aaa}-@var{dd}} (where @var{aaa} are -letters and @var{dd} are digits); otherwise it is matched against +letters and @var{dd} are digits); otherwise it is matched against the second alternative, @samp{@var{dd}-@var{dd}-@var{dd}}. |