~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

Viewing changes to man/replace.1

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
ImportĀ upstreamĀ versionĀ 5.1.45

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
'\" t
 
2
.\"     Title: \fBreplace\fR
 
3
.\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 
4
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
 
5
.\"      Date: 03/01/2010
 
6
.\"    Manual: MySQL Database System
 
7
.\"    Source: MySQL 5.1
 
8
.\"  Language: English
 
9
.\"
 
10
.TH "\FBREPLACE\FR" "1" "03/01/2010" "MySQL 5\&.1" "MySQL Database System"
 
11
.\" -----------------------------------------------------------------
 
12
.\" * set default formatting
 
13
.\" -----------------------------------------------------------------
 
14
.\" disable hyphenation
 
15
.nh
 
16
.\" disable justification (adjust text to left margin only)
 
17
.ad l
 
18
.\" -----------------------------------------------------------------
 
19
.\" * MAIN CONTENT STARTS HERE *
 
20
.\" -----------------------------------------------------------------
 
21
.\" replace utility
 
22
.\" string replacement: replace utility
 
23
.SH "NAME"
 
24
replace \- a string\-replacement utility
 
25
.SH "SYNOPSIS"
 
26
.HP \w'\fBreplace\ \fR\fB\fIarguments\fR\fR\ 'u
 
27
\fBreplace \fR\fB\fIarguments\fR\fR
 
28
.SH "DESCRIPTION"
 
29
.PP
 
30
The
 
31
\fBreplace\fR
 
32
utility program changes strings in place in files or on the standard input\&.
 
33
.PP
 
34
Invoke
 
35
\fBreplace\fR
 
36
in one of the following ways:
 
37
.sp
 
38
.if n \{\
 
39
.RS 4
 
40
.\}
 
41
.nf
 
42
shell> \fBreplace \fR\fB\fIfrom\fR\fR\fB \fR\fB\fIto\fR\fR\fB [\fR\fB\fIfrom\fR\fR\fB \fR\fB\fIto\fR\fR\fB] \&.\&.\&. \-\- \fR\fB\fIfile_name\fR\fR\fB [\fR\fB\fIfile_name\fR\fR\fB] \&.\&.\&.\fR
 
43
shell> \fBreplace \fR\fB\fIfrom\fR\fR\fB \fR\fB\fIto\fR\fR\fB [\fR\fB\fIfrom\fR\fR\fB \fR\fB\fIto\fR\fR\fB] \&.\&.\&. < \fR\fB\fIfile_name\fR\fR
 
44
.fi
 
45
.if n \{\
 
46
.RE
 
47
.\}
 
48
.PP
 
49
\fIfrom\fR
 
50
represents a string to look for and
 
51
\fIto\fR
 
52
represents its replacement\&. There can be one or more pairs of strings\&.
 
53
.PP
 
54
Use the
 
55
\fB\-\-\fR
 
56
option to indicate where the string\-replacement list ends and the file names begin\&. In this case, any file named on the command line is modified in place, so you may want to make a copy of the original before converting it\&.
 
57
\fIreplace\fR
 
58
prints a message indicating which of the input files it actually modifies\&.
 
59
.PP
 
60
If the
 
61
\fB\-\-\fR
 
62
option is not given,
 
63
\fBreplace\fR
 
64
reads the standard input and writes to the standard output\&.
 
65
.PP
 
66
\fBreplace\fR
 
67
uses a finite state machine to match longer strings first\&. It can be used to swap strings\&. For example, the following command swaps
 
68
a
 
69
and
 
70
b
 
71
in the given files,
 
72
file1
 
73
and
 
74
file2:
 
75
.sp
 
76
.if n \{\
 
77
.RS 4
 
78
.\}
 
79
.nf
 
80
shell> \fBreplace a b b a \-\- file1 file2 \&.\&.\&.\fR
 
81
.fi
 
82
.if n \{\
 
83
.RE
 
84
.\}
 
85
.PP
 
86
The
 
87
\fBreplace\fR
 
88
program is used by
 
89
\fBmsql2mysql\fR\&. See
 
90
\fBmsql2mysql\fR(1)\&.
 
91
.PP
 
92
\fBreplace\fR
 
93
supports the following options\&.
 
94
.sp
 
95
.RS 4
 
96
.ie n \{\
 
97
\h'-04'\(bu\h'+03'\c
 
98
.\}
 
99
.el \{\
 
100
.sp -1
 
101
.IP \(bu 2.3
 
102
.\}
 
103
\fB\-?\fR,
 
104
\fB\-I\fR
 
105
.sp
 
106
Display a help message and exit\&.
 
107
.RE
 
108
.sp
 
109
.RS 4
 
110
.ie n \{\
 
111
\h'-04'\(bu\h'+03'\c
 
112
.\}
 
113
.el \{\
 
114
.sp -1
 
115
.IP \(bu 2.3
 
116
.\}
 
117
\fB\-#\fR\fB\fIdebug_options\fR\fR
 
118
.sp
 
119
Enable debugging\&.
 
120
.RE
 
121
.sp
 
122
.RS 4
 
123
.ie n \{\
 
124
\h'-04'\(bu\h'+03'\c
 
125
.\}
 
126
.el \{\
 
127
.sp -1
 
128
.IP \(bu 2.3
 
129
.\}
 
130
\fB\-s\fR
 
131
.sp
 
132
Silent mode\&. Print less information what the program does\&.
 
133
.RE
 
134
.sp
 
135
.RS 4
 
136
.ie n \{\
 
137
\h'-04'\(bu\h'+03'\c
 
138
.\}
 
139
.el \{\
 
140
.sp -1
 
141
.IP \(bu 2.3
 
142
.\}
 
143
\fB\-v\fR
 
144
.sp
 
145
Verbose mode\&. Print more information about what the program does\&.
 
146
.RE
 
147
.sp
 
148
.RS 4
 
149
.ie n \{\
 
150
\h'-04'\(bu\h'+03'\c
 
151
.\}
 
152
.el \{\
 
153
.sp -1
 
154
.IP \(bu 2.3
 
155
.\}
 
156
\fB\-V\fR
 
157
.sp
 
158
Display version information and exit\&.
 
159
.RE
 
160
.SH "COPYRIGHT"
 
161
.br
 
162
.PP
 
163
Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
 
164
.PP
 
165
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
 
166
.PP
 
167
This documentation is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
168
.PP
 
169
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/.
 
170
.sp
 
171
.SH "SEE ALSO"
 
172
For more information, please refer to the MySQL Reference Manual,
 
173
which may already be installed locally and which is also available
 
174
online at http://dev.mysql.com/doc/.
 
175
.SH AUTHOR
 
176
Sun Microsystems, Inc. (http://www.mysql.com/).