Lines Matching +refs:po +refs:mark +refs:bash +refs:string
105 @c black boxes that mark lines that are too long. Thus, it is
387 * Scalar Constants:: Numeric and string constants.
476 * String Functions:: Functions for string manipulation, such as
485 * I18N Functions:: Functions for string translation.
530 * Join Function:: A function to join an array into a string.
1952 With Unix @command{awk}, closing the quoted string produces this result:
1985 POSIX-compliant, Bourne-style shells (such as @command{bash}, the GNU Bourne-Again
2044 be set to the null string, use:
2200 input file @file{BBS-list} for the character string @samp{foo} (a
2201 grouping of characters is usually called a @dfn{string};
2202 the term @dfn{string} is based on similar usage in English, such
2203 as ``a string of pearls,'' or ``a string of cars in a train''):
2215 You will notice that slashes (@samp{/}) surround the string @samp{foo}
2378 The first rule has the string @samp{12} as the
2380 string @samp{21} as the pattern and also has @samp{print $0} as the
2383 This program prints every line that contains the string
2384 @samp{12} @emph{or} the string @samp{21}. If a line contains both
2437 shell or @command{bash}, you can type the example as shown. If the command
2471 matches the string @samp{Nov}. Each time a line has the string
2527 in the middle of a string or regular expression. For example:
2546 split a string constant using backslash continuation. Thus, for maximum
2548 lines in the middle of a regular expression or a string.
2558 shell, such as the Unix Bourne shell or @command{bash}. But the C shell behaves
2642 common computational and string-related operations.
2644 performing bit manipulation, and for runtime string translation.
2680 language. Emacs Lisp is a good choice if you need sophisticated string
2681 or pattern matching capabilities. The shell is also good at string and
2706 both. Such a regexp matches any string that contains that sequence.
2707 Thus, the regexp @samp{foo} matches any string containing @samp{foo}.
2738 following prints the second field of each record that contains the string
2750 @cindex operators, string-matching
2752 @cindex string-matching operators
2765 expressions allow you to specify the string to match against; it need
2778 is true if the expression @var{exp} (taken as a string)
2798 (taken as a character string)
2822 @code{"foo"} is a string constant.
2830 Some characters cannot be included literally in string constants
2835 a string constant. Because a plain double quote ends the string, you
2837 part of the string. For example:
2846 string or regexp. Thus, the string whose contents are the two characters
2851 unprintable characters directly in a string constant or regexp constant,
2857 sequences apply to both string constants and regexp constants:
2933 A literal double quote (necessary for string constants only).
2934 This expression is used when you want to write a string
2935 constant that contains a double quote. Because the string is delimited by
2936 double quotes, you need to escape the quote that is part of the string,
2937 in order to tell @command{awk} to keep processing the rest of the string.
2962 for both string constants and regexp constants. This happens very early,
2979 @cindex POSIX @command{awk}, backslashes in string constants
2984 If you place a backslash in a string constant before something that is
2998 two backslashes in the string @samp{FS = @w{"[ \t]+\\|[ \t]+"}}.)
3063 This matches the beginning of a string. For example, @samp{^@@chapter}
3064 matches @samp{@@chapter} at the beginning of a string and can be used
3067 match only at the beginning of the string.
3070 a line embedded in a string.
3080 This is similar to @samp{^}, but it matches only at the end of a string.
3083 and does not match the end of a line embedded in a string.
3095 matches any single character followed by a @samp{P} in a string. Using
3119 the characters @samp{M}, @samp{V}, or @samp{X} in a string. A full
3140 matches any string that matches either @samp{^P} or @samp{[[:digit:]]}. This
3141 means it matches any string that starts with @samp{P} or contains a digit.
3169 prints every record in @file{sample} containing a string of the form
3188 @cindex @code{?} (question mark)
3189 @cindex question mark (@code{?})
3234 using a string constant with a regexp operator or function.}
3473 Matches the empty string at the beginning of a word.
3481 Matches the empty string at the end of a word.
3490 Matches the empty string at either the beginning or the
3498 Matches the empty string that occurs between two
3506 @cindex operators, string-matching, for buffers
3510 string to match as the buffer.
3518 Matches the empty string at the
3519 beginning of a buffer (string).
3525 Matches the empty string at the
3526 end of a buffer (string).
3531 @cindex @code{?} (question mark)
3532 @cindex question mark (@code{?})
3612 @code{tolower} or @code{toupper} built-in string functions (which we
3636 When @code{IGNORECASE} is not zero, @emph{all} regexp and string
3671 affected regexp operations only. It did not affect string comparison
3673 Beginning with @value{PVERSION} 3.0, both regexp and string comparison
3744 regexp constant (i.e., a string of characters between slashes). It may
3745 be any expression. The expression is evaluated and converted to a string
3746 if necessary; the contents of the string are used as the
3763 enclosed in slashes and a string constant enclosed in double quotes.
3764 If you are going to use a string constant, you have to understand that
3765 the string is, in essence, scanned @emph{twice}: the first time when
3767 match the string on the lefthand side of the operator with the pattern
3768 on the right. This is true of any string-valued expression (such as
3769 @code{digits_regexp}, shown previously), not just string constants.
3776 What difference does it make if the string is
3779 string, you have to type two backslashes.
3782 Only one backslash is needed. To do the same thing with a string,
3784 second one so that the string actually contains the
3787 @cindex troubleshooting, regexp constants vs. string constants
3788 @cindex regexp constants, vs. string constants
3789 @cindex string constants, vs. regexp constants
3790 Given that you can use both regexp and string constants to describe
3804 makes pattern matching more efficient. When using a string constant,
3805 @command{awk} must first convert the string into this internal form and
3976 which indicate a string constant. Often the right time to do this is
3991 This is a string whose first character is a slash; as a result, records
4080 The empty string @code{""} (a string without any characters)
4103 string. It can be any regular expression
4106 ends at the next string that matches the regular expression; the next
4107 record starts at the end of the matching string. This general rule is
4109 newline: a record ends at the beginning of the next matching string (the
4111 the end of this string (at the first character of the following line).
4186 @sc{nul} character as the string terminator. In effect, this means that
4213 Whitespace in @command{awk} means any string of one or more spaces,
4229 @c The comma here does NOT mark a secondary term:
4259 the empty string. (If used in a numeric operation, you get zero.)
4276 field contains the string @samp{foo}. The operator @samp{~} is called a
4279 it tests whether a string (here, the field @code{$1}) matches a given regular
4303 value is a string, rather than a number, it is converted to a number.
4378 as a number; the string of characters must be converted to a number
4380 from the subtraction is converted back to a string of characters that
4438 Referencing an out-of-range field only produces an empty string. For
4458 even when you assign the empty string to a field. For example:
4564 the Unix Bourne shell, @command{sh}, or @command{bash}).
4574 For example, here we set the value of @code{FS} to the string
4590 this @command{awk} program extracts and prints the string
4619 is a string containing a single space, @w{@code{" "}}. If @command{awk}
4643 More generally, the value of @code{FS} may be a string containing any
4725 simply assigning the null string (@code{""}) to @code{FS}. In this case,
4740 @cindex dark corner, @code{FS} as null string
4741 @cindex FS variable, as null string
4748 if @code{FS} is the null string, then @command{gawk} also
4860 arnold:xyzzy:2076:10:Arnold Robbins:/home/arnold:/bin/bash
4873 It is important to remember that when you assign a string constant
4874 as the value of @code{FS}, it undergoes normal @command{awk} string
4876 the assignment @samp{FS = "\.."} assigns the character string @code{".."}
5014 assigning a string containing space-separated numbers to the built-in
5033 brent ttyp0 26Jun91 4:46 26:46 4:41 bash
5079 the United States, voters mark their choices by punching holes in computer
5129 One technique is to use an unusual character or string to separate
5133 @code{"\f"} (a string containing the formfeed character). Any
5139 dispensation, an empty string as the value of @code{RS} indicates that
5141 to the empty string, each record always ends at the first blank line
5151 string @code{"\n\n+"} to @code{RS}. This regexp matches the newline
5173 string, @emph{and} @code{FS} is a set to a single character,
5176 @code{FS}.@footnote{When @code{FS} is the null string (@code{""})
5196 variable @code{FS} to the string @code{"\n"}. (This single
5316 @code{ERRNO} to a string describing the error that occurred.
5318 In the following examples, @var{command} stands for a string value that
5401 For example, suppose the next line is a comment or a special string,
5452 Here @var{file} is a string-valued expression that
5492 is a string-valued expression that specifies the file from which to read.
5540 this case, the string @var{command} is run as a shell command and its output
5856 line, use @samp{print ""}, where @code{""} is the empty string.
5857 To print a fixed piece of text, use a string constant, such as
5867 isn't limited to only one line. If an item value is a string that contains a
5868 newline, the newline is output along with the rest of the string. A
5872 The following is an example of printing a string that contains embedded newlines
5902 juxtaposing two string expressions in @command{awk} means to concatenate
5978 a single space is only the default. Any string of
5981 is the string @w{@code{" "}}---that is, a single space.
5985 record, and then outputs a string called the @dfn{output record separator}
5987 value of @code{ORS} is the string @code{"\n"}; i.e., a newline
6037 @command{awk} internally converts the number to a string of characters
6038 and prints that string. @command{awk} uses the @code{sprintf} function
6054 number to a string for printing.
6088 after the decimal point). This is done by supplying a string, called
6089 the @dfn{format string}, that controls how and where to print the other
6117 argument. This is an expression whose value is taken as a string; it
6119 @dfn{format string}.
6121 The format string is very similar to that in the ISO C library function
6128 to its output. It outputs only what the format string specifies.
6129 So if a newline is needed, you must include one in the format string.
6161 65} outputs the letter @samp{A}. (The output for a string value is
6162 the first character of the string.)
6206 This prints a string.
6258 given in the format string. With a positional specifier, the format
6363 Maximum number of characters from the string that should print.
6379 string, they are passed in the argument list. For example:
6400 concatenation to build up the format string, like so:
6438 @file{BBS-list} as a string of 10 characters that are left-justified. It also
6542 expression. Its value is changed to a string and then used as a
6590 expression. Its value is converted to a string whose contents give
6623 The message is built using string concatenation and saved in the variable
6635 use a string constant. Using a variable is generally a good idea,
6636 because @command{awk} requires that the string value be spelled identically
6716 The @code{tolower} function returns its argument string with all
6832 Like any other redirection, the value must be a string.
7030 value must @emph{exactly} match the string that was used to open the file or
7151 The second argument should be a string, with either of the values
7184 @code{ERRNO} to a string describing the problem.
7288 string, and regular expression.
7295 * Scalar Constants:: Numeric and string constants.
7319 @cindex string constants
7320 A string constant consists of a sequence of characters enclosed in
7330 represents the string whose contents are @samp{parrot}. Strings in
7608 Variables in @command{awk} can be assigned either numeric or string values.
7610 By default, variables are initialized to the empty string, which
7693 happens to be a string, it is converted to a number before the addition
7694 is performed. If numeric values appear in string concatenation, they
7705 concatenated together. The resulting string is converted back to the
7711 string, concatenate the empty string, @code{""}, with that number.
7712 To force a string to be converted to a number, add zero to that string.
7713 A string is converted to a number by interpreting any numeric prefix
7714 of the string as numerals:
7737 Strange results can occur if you set @code{CONVFMT} to a string that doesn't
7740 all numbers to the same constant string.
7742 it to a string is @emph{always} an integer, no matter what the value of
7787 and for number to string conversion, the local decimal point character is used.
7931 @cindex string operators
7932 @cindex operators, string
7934 There is only one string operation: concatenation. It does not have a
7945 Without the space in the string constant after the @samp{:}, the line
7955 @cindex troubleshooting, string concatenation
7956 Because string concatenation does not have an explicit operator, it is
7980 Be careful about the kinds of expressions used in string concatenation.
8074 Assignments can also store string values. For example, the
8086 This also illustrates string concatenation.
8115 @code{foo} has a numeric value at first, and a string value later on:
8125 When the second assignment gives @code{foo} a string value, the fact that
8132 foo = "a string"
8137 @strong{Note:} Using a variable as a number and then later as a string
8473 nonempty string value is true. Any other value (zero or the null
8474 string @code{""}) is false. The following program prints @samp{A strange
8490 the string constant @code{"0"} is actually true, because it is non-null.
8514 fixed type. Instead, they can be either a number or a string, depending
8521 the concept of a @dfn{numeric string}, which is simply a string that looks
8534 A string constant or the result of a string operation has the @var{string}
8541 have the @var{strnum} attribute. Otherwise, they have the @var{string}
8549 @c value such that it has both a numeric and string value, this leaves the
8555 @code{a} has numeric type, even though it is later used in a string
8566 When two operands are compared, either string comparison or numeric comparison
8608 STRING &&string &string &string\cr
8609 NUMERIC &&string &numeric &numeric\cr
8610 STRNUM &&string &numeric &numeric\cr
8619 STRING | string string string
8621 NUMERIC | string numeric numeric
8623 STRNUM | string numeric numeric
8630 made of characters and is therefore also a string.
8631 Thus, for example, the string constant @w{@code{" +3.14"}}
8632 is a string, even though it looks numeric,
8636 In short, when one operand is a ``pure'' string, such as a string
8637 constant, then a string comparison is performed. Otherwise, a
8684 True if the string @var{x} matches the regexp denoted by @var{y}.
8687 True if the string @var{x} does not match the regexp denoted by @var{y}.
8701 strings where one is a prefix of the other, the shorter string is less than
8717 Unless @code{b} happens to be zero or the null string, the @code{if}
8731 string comparison (false)
8734 string comparison (true)
8737 string comparison (true)
8741 string comparison (true)
8745 string comparison (false)
8755 @cindex comparison expressions, string vs. regexp
8756 @c @cindex string comparison vs. regexp comparison
8757 @c @cindex regexp comparison vs. string comparison
8790 expression. In the latter case, the value of the expression as a string is used as a
9067 treated as local variables and initialized to the empty string
9245 @cindex @code{?} (question mark), @code{?:} operator
9246 @cindex question mark (@code{?}), @code{?:} operator
9327 is nonzero (if a number) or non-null (if a string).
9370 number) or non-null (if a string).
9383 The left operand of the @samp{~} and @samp{!~} operators is a string.
9385 slashes (@code{/@var{regexp}/}), or any expression whose string value
9449 @file{BBS-list} that do @emph{not} contain the string @samp{foo}:
9600 that contain the string @samp{foo}. The @code{BEGIN} rule prints a title
9653 yield a null string or zero, depending upon the context. One way
9676 @samp{print $0}. If @code{$0} is the null string, then this prints an
9767 Now, the @command{awk} program is just one single-quoted string.
9926 the null string; otherwise, the condition is true.
9983 is not zero and not a null string.)
10611 string values of @code{"r"} or @code{"w"} specify that input files and
10613 A string value of @code{"rw"} or @code{"wr"} indicates that all
10615 Any other string value is equivalent to @code{"rw"}, but @command{gawk}
10634 This string controls conversion of numbers to
10665 The value is a single-character string or a multi-character regular
10667 record. If the value is the null string (@code{""}), then each
10670 specify the behavior when @code{FS} is the null string.)
10674 The default value is @w{@code{" "}}, a string consisting of a single
10695 @cindex case sensitivity, string comparisons and
10699 If @code{IGNORECASE} is nonzero or non-null, then all string comparisons
10713 then @code{IGNORECASE} has no special meaning. Thus, string
10743 This string controls conversion of numbers to
10760 default value is @w{@code{" "}}, a string consisting of a single space.
10772 This is @command{awk}'s input record separator. Its default value is a string
10775 It can also be the null string, in which case records are separated by
10804 marked string constants in the source text, as well as for the
10881 @c comma before ARGIND does NOT mark a tertiary
10920 then @code{ERRNO} contains a string describing the error.
11034 is the length of the matched string, or @minus{}1 if no match is found.
11042 is the position of the string where the matched substring starts, or zero
11143 different string there, a program can change which files are read.
11153 To eliminate a file from the middle of the list, store the null string
11156 replaced with the null string.
11273 Additionally, any number or string in @command{awk}, not just consecutive integers,
11375 have to be positive integers. Any number, or even a string, can be
11394 automatically converts it to a string.
11400 The identical string value used to store an array element must be used
11433 @code{""}, the null string. This includes elements
11436 automatically creates that array element, with the null string as its value.
11570 in @command{awk}, because any number or string can be an array index.
11666 same as assigning it a null value (the empty string, @code{""}).
11714 apart the null string. Because there is no data to split out, the
11734 it is converted to a string value before being used for subscripting
11752 @code{data[xyz]} subscripts @code{data} with the string value @code{"12.153"}
11757 string value from @code{xyz}---this time @code{"12.15"}---because the value of
11759 since @code{"12.15"} is a different string from @code{"12.153"}.
11844 Even though it is somewhat unusual, the null string
11847 @command{gawk} warns about the use of the null string as a subscript
11865 concatenation of indices into one string.
11869 a single string that describes the values of the separate indices. The
11870 combined string is used as a single index into an ordinary,
11885 The default value of @code{SUBSEP} is the string @code{"\034"},
11889 that index values that contain a string matching @code{SUBSEP} can lead to
12101 string comparisons, the value of @code{IGNORECASE} also
12114 which fall into three categories: numeric, string, and I/O.
12143 * String Functions:: Functions for string manipulation, such as
12148 * I18N Functions:: Functions for string translation.
12400 the comparison performed is always a string comparison. (Here too,
12412 This searches the string @var{in} for the first occurrence of the string
12414 begins in the string @var{in}. Consider the following example:
12423 (Remember that string indices in @command{awk} start at one.)
12425 @item length(@r{[}@var{string}@r{]})
12427 This returns the number of characters in @var{string}. If
12428 @var{string} is a number, the length of the digit string representing
12431 525, and 525 is then converted to the string @code{"525"}, which has
12448 @item match(@var{string}, @var{regexp} @r{[}, @var{array}@r{]})
12450 The @code{match} function searches @var{string} for the
12454 @var{string}). If no match is found, it returns zero.
12457 (@samp{/@dots{}/}) or a string constant (@var{"@dots{}"}).
12458 In the latter case, the string is treated as a regexp to be matched.
12463 The order of the first two arguments is backwards from most other string
12467 @samp{@var{string} ~ @var{regexp}}.
12522 of @var{array} is set to the entire portion of @var{string}
12525 portion of @var{string} matching the corresponding parenthesized
12564 @item split(@var{string}, @var{array} @r{[}, @var{fieldsep}@r{]})
12566 This function divides @var{string} into pieces separated by @var{fieldsep}
12569 forth. The string value of the third argument, @var{fieldsep}, is
12570 a regexp describing where to split @var{string} (much as @code{FS} can
12584 splits the string @samp{cul-de-sac} into three fields using @samp{-} as the
12600 Also as with input field-splitting, if @var{fieldsep} is the null string, each
12601 individual character in the string is split into its own array element.
12611 string.
12615 discussion of the difference between using a string constant or a regexp constant,
12618 Before splitting the string, @code{split} deletes any previously existing
12621 If @var{string} is null, the array has no elements. (So this is a portable
12625 If @var{string} does not match @var{fieldsep} at all (but is not null),
12627 @var{string}.
12631 This returns (without printing) the string that @code{printf} would
12641 assigns the string @w{@code{"pi = 3.14 (approx.)"}} to the variable @code{pival}.
12659 to a string value; the automatic coercion of strings to numbers
12671 It searches this value, which is treated as a string, for the
12673 Then the entire string is
12675 The modified string becomes the new value of @var{target}.
12678 (@samp{/@dots{}/}) or a string constant (@var{"@dots{}"}).
12679 In the latter case, the string is treated as a regexp to be matched.
12709 the regexp can match more than one string, then this precise substring
12731 This shows how @samp{&} can represent a nonconstant string and also
12736 backslash before it in the string. As usual, to insert one backslash in
12737 the string, you must write two backslashes. Therefore, write @samp{\\&}
12738 in a string constant to include a literal @samp{&} in the replacement.
12769 string, and then the value of that string is treated as the regexp to match.
12783 replaces all occurrences of the string @samp{Britain} with @samp{United
12795 @code{gsub}, it searches the target string @var{target} for matches of
12797 the modified string is returned as the result of the function and the
12798 original target string is @emph{not} changed. If @var{how} is a string
12807 the regexp to mark the components and then specifying @samp{\@var{N}}
12823 to get one into the string.
12836 In this case, @code{$0} is used as the default target string.
12837 @code{gensub} returns the new string as its result, which is
12842 If the @var{how} argument is a string that does not begin with @samp{g} or
12853 @item substr(@var{string}, @var{start} @r{[}, @var{length}@r{]})
12855 This returns a @var{length}-character-long substring of @var{string},
12857 string is character number one.@footnote{This is different from
12862 @var{string} that begins at character number @var{start}. For example,
12866 in the string, counting from character @var{start}.
12873 in the string, @code{substr} returns the null string.
12875 the null string is returned.
12878 The string returned by @code{substr} @emph{cannot} be
12880 a string, as shown in the following example:
12883 string = "abcdef"
12885 substr(string, 3, 3) = "CDE"
12900 If you need to replace bits and pieces of a string, combine @code{substr}
12901 with string concatenation, in the following manner:
12904 string = "abcdef"
12906 string = substr(string, 1, 2) "CDE" substr(string, 6)
12911 @item tolower(@var{string})
12913 This returns a copy of @var{string}, with each uppercase character
12914 in the string replaced with its corresponding lowercase character.
12918 @item toupper(@var{string})
12920 This returns a copy of @var{string}, with each lowercase character
12921 in the string replaced with its corresponding uppercase character.
12945 replacement string to determine what to generate.
12954 @samp{\} and put the next character into the string. Thus, for
12962 the @var{replacement} string that did not precede an @samp{&} was passed
13053 Backslashes must now be doubled in the @var{replacement} string, breaking
13058 in the @var{replacement} string must be preceded with a
13167 In @command{awk}, the @samp{*} operator can match the null string.
13198 should be one of the two string values @code{"to"} or @code{"from"},
13199 indicating which end of the pipe to close. Case in the string does
13232 standard output is flushed. The second is to allow the null string
13255 function executes the command given by the string @var{command}.
13345 buffers is to call @code{system} with a null string as its argument:
13445 same name in ISO C. The argument, @var{datespec}, is a string of the form
13447 The string consists of six or seven numbers representing, respectively,
13471 This function returns a string. It is similar to the function of the
13473 produce a string, based on the contents of the @var{format} string.
13478 @code{@w{"%a %b %d %H:%M:%S %Z %Y"}}. This format string produces
13501 returned string, while substituting date and time values for format
13502 specifications in the @var{format} string.
13662 returned string or appears literally.}
13718 the string. For example:
13841 For example, if you have a bit string @samp{10111001} and you shift it
13993 The @code{bits2str} function turns a binary number into a string.
13999 of the string.
14021 @cindex @command{gawk}, string-translation functions
14022 @cindex functions, string-translation
14035 @item dcgettext(@var{string} @r{[}, @var{domain} @r{[}, @var{category}@r{]]})
14036 This function returns the translation of @var{string} in
14060 If @var{directory} is the null string (@code{""}), then
14125 the call. The local variables are initialized to the empty string.
14145 null string.
14191 If the resulting string is non-null, the action is executed.
14260 The following is an example of a recursive function. It takes a string
14261 as an input parameter and returns the string in backwards order.
14264 is zero, i.e., when there are no more characters left in the string.
14286 The C @code{ctime} function takes a timestamp and returns it in a string,
14325 being a string concatenation):
14353 string value @code{"bar"}.
14641 and marks each string that is a candidate for translation.
14655 collected into a portable object file (@file{guide.po}),
14661 @cindex @code{.po} files
14662 @cindex files, @code{.po}
14666 For each language with a translator, @file{guide.po}
14674 Each language's @file{.po} file is converted into a binary
14695 At runtime, @command{guide} looks up each string via a call
14696 to @code{gettext}. The returned string is the translated string
14697 if available, or the original string if not.
14707 In C (or C++), the string marking and dynamic translation lookup
14708 are accomplished by wrapping each string in a call to @code{gettext}:
14735 This reduces the typing overhead to just three extra characters per string
14820 @item dcgettext(@var{string} @r{[}, @var{domain} @r{[}, @var{category}@r{]]})
14821 This built-in function returns the translation of @var{string} in
14826 If you supply a value for @var{category}, it must be a string equal to
14868 If @var{directory} is the null string (@code{""}), then
14900 @cindex @code{_} (underscore), translatable string
14901 @cindex underscore (@code{_}), translatable string
14905 quote of the string. For example:
14956 @cindex @code{.po} files
14957 @cindex files, @code{.po}
14961 be extracted to create the initial @file{.po} file.
14965 @command{gawk}'s @option{--gen-po} command-line option extracts
14982 @cindex @code{--gen-po} option
14983 @cindex command-line options, string extraction
14984 @cindex string extraction (internationalization)
14985 @cindex marked string extraction (internationalization)
14988 @cindex @code{--gen-po} option
14992 First, use the @option{--gen-po} command-line option to create
14993 the initial @file{.po} file:
14996 $ gawk --gen-po -f guide.awk > guide.po
15000 When run with @option{--gen-po}, @command{gawk} does not execute your
15027 string, length(string)))
15038 Even though @code{gettext} can return the translated string
15052 format string itself is @emph{not} included. Thus, in the following
15053 example, @samp{string} is the first argument and @samp{length(string)} is the second:
15057 > string = "Dont Panic"
15059 > string, length(string)
15089 and those with positional specifiers in the same string:
15138 as the concatenation of a variable named @code{_} with the string
15141 the null string (@code{""}) as its value, leaving the original string constant as
15160 function dcgettext(string, domain, category)
15162 return string
15184 retrieve the translated string, this should not be a problem in practice.
15208 Run @samp{gawk --gen-po} to create the @file{.po} file:
15211 $ gawk --gen-po -f guide.awk > guide.po
15218 @c file eg/data/guide.po
15232 is the original string and the @code{msgstr} is the translation.
15235 appear in the @file{guide.po} file.
15244 $ cp guide.po guide-mellow.po
15245 @var{Add translations to} guide-mellow.po @dots{}
15253 @c file eg/data/guide-mellow.po
15277 @cindex @code{.po} files, converting to @code{.mo}
15278 @cindex files, @code{.po}, converting to @code{.mo}
15279 @cindex @code{.mo} files, converting from @code{.po}
15280 @cindex files, @code{.mo}, converting from @code{.po}
15287 @file{.po} file to machine-readable @file{.mo} file.
15293 $ msgfmt guide-mellow.po
15938 All string concatenations are parenthesized too.
16274 @item -W gen-po
16275 @itemx --gen-po
16276 @cindex @code{--gen-po} option
16281 output for all string constants that have been marked for translation.
16504 For a Bourne-compatible shell (such as @command{bash}), you would add these
16614 The search path is a string consisting of directory names
16772 The comparison used for sorting is simple string comparison;
16902 Also, verify that all regexp and string constants used in
17027 * Join Function:: A function to join an array into a string.
17137 is reset to the empty string, so that further executions of this rule
17203 The C language makes it possible to turn the condition into a string for use
17205 this @code{assert} function also requires a string version of the condition
17223 function assert(condition, string)
17227 FILENAME, FNR, string) > "/dev/stderr"
17243 is false, it prints a message to standard error, using the @code{string}
17414 character in the machine's character set. If the string passed to
17451 # ascii, mark parity
17471 @cindex mark parity
17482 used ASCII, but with mark parity, meaning that the leftmost bit in the byte
17532 When doing string processing, it is often useful to be able to join
17533 all the strings in an array into one long string. The following function,
17548 # join.awk --- join an array into a string
17582 The lack of an explicit operator for concatenation makes string operations
17600 with preformatted time information. It returns a string with the current
17617 # Returns a string in the format of output of date(1)
17677 The string indices are easier to use and read than the various formats
17761 string. The program then assigns the current @value{FN} to
17764 initialized to the null string, this rule executes correctly even for the
18111 @option{-F} option requires a string to use as the field separator.
18113 string that does not begin with @samp{-} ends the options.
18117 command-line arguments. The programmer provides a string describing the
18119 string with a colon. @code{getopt} is also passed the
18156 The string value of the argument to an option.
18237 # Optarg -- string value of argument to current option
18257 The @code{getopt} function first checks that it was indeed called with a string of options
18321 the string of the next character to look at (we skip the @samp{-}, which
18326 If @code{thisopt} is not in the @code{options} string, then it is an
18357 in the @code{options} string. If there are remaining characters in the
18359 string is assigned to @code{Optarg}. Otherwise, the next command-line
18580 shell, such as @command{bash}.
18600 shell, such as @command{bash}.
18718 The @code{getpwnam} function takes a username as a string argument. If that
18720 returns the null string:
18741 returns the null string:
19086 string:
19391 string:
20464 simply returns one or zero depending upon the result of a simple string
21056 split each character in a string into separate array elements.}
21069 The string on which to do the translation.
21184 The @code{BEGIN} rule simply sets @code{RS} to the empty string, so that
21843 is set to the null string. In this case, we can print @code{$0} using
21850 @code{ARGV[1]} and @code{ARGV[2]} to the null string, so that they are
22051 # diagnostic if $x is the null string
22242 into the command line. It is saved as a single string, even if the results
22322 in C or C++, and it is frequently easier to do certain kinds of string
22555 The @code{toupper} and @code{tolower} built-in string functions
22597 The concept of a numeric string and tighter comparison rules to go
22831 @code{IGNORECASE} changed, now applying to string comparison as well
22988 The @option{--gen-po} command-line option and the use of a leading
22989 underscore to mark strings that should be translated
23463 @itemx po/*
23465 @command{gawk}'s internationalization features, while the @file{po} library
23789 BeOS uses @command{bash} as its shell; thus, you use @command{gawk} the same way you would
24068 Daisuke Aoyama has ported GNU @command{bash} to MS-DOS using the DJGPP tools,
24100 @code{BINMODE=@var{non-null-string}} is
24103 message if the string is not one of @code{"rw"} or @code{"wr"}.
24170 GNU tools, such as @command{bash}, the GNU Compiler Collection (GCC),
24324 single parameter (as in the quoted string program above), the command
24427 With a reasonable shell (@command{bash} will do), you have a pretty good chance
25246 This macro guarantees that a @code{NODE}'s string value is current.
25248 It also guarantees that the string is zero-terminated.
25260 The data and length of a @code{NODE}'s string value, respectively.
25261 The string is @emph{not} guaranteed to be zero-terminated.
25262 If you need to pass the string value to a C library function, save
25296 Take a C string and turn it into a pointer to a @code{NODE} that
25309 Take a C string and turn it into a pointer to a @code{NODE} that
25337 function @code{name}. @code{name} is a regular C string. @code{count}
25476 is set to a string indicating the error.
25535 The file's ``printable mode.'' This is a string representation of
25540 A printable string representation of the file's type. The value
25636 the argument to be a string and passes the string value to the
26319 @cindex values, string
26322 values, such as 42 or 3.1415927, or string values.
26326 Individual variables, as well as numeric and string variables, are
26372 It is called the @dfn{null string}.
26373 The null string is character data that has no value.
26430 (double-precision floating-point) and the string value for a variable.
26436 It is important to note that the string value for a number may not
26458 using @code{printf}, and then prints the string values obtained
26472 what the default string representations show.
26569 to the beginning or end of the string, respectively.
26646 Many shells (@command{bash}, @command{ksh}, @command{pdksh}, @command{zsh}) are
26651 numerical, I/O-related, and string computations. Examples are
26653 substring of a string).
26655 and runtime string translation.
26747 producing a new string. For example, the string @samp{foo} concatenated with
26748 the string @samp{bar} gives the string @samp{foobar}.
26805 ordinary expression. It could be a string constant, such as
26859 are controlled by the format string contained in the built-in variable
27020 The act of testing a string against a regular expression. If the
27021 regexp describes the contents of the string, it is said to @dfn{match} it.
27029 A string with no characters in it. It is represented explicitly in
27100 @samp{R.*xp} matches any string starting with the letter @samp{R}
27127 A single value, be it a number or a string.
27182 string}. Constant strings are written with double quotes in the
27224 record or a string.