replace.1 4.28 KB
Newer Older
1
'\" t
2
.\"     Title: \fBreplace\fR
3 4
.\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
5
.\"      Date: 04/06/2010
6 7
.\"    Manual: MySQL Database System
.\"    Source: MySQL 5.1
8
.\"  Language: English
9
.\"
10
.TH "\FBREPLACE\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System"
11 12 13
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
14 15 16 17
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
18 19 20 21 22
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.\" replace utility
.\" string replacement: replace utility
23 24 25
.SH "NAME"
replace \- a string\-replacement utility
.SH "SYNOPSIS"
26
.HP \w'\fBreplace\ \fR\fB\fIarguments\fR\fR\ 'u
27 28 29 30 31
\fBreplace \fR\fB\fIarguments\fR\fR
.SH "DESCRIPTION"
.PP
The
\fBreplace\fR
32
utility program changes strings in place in files or on the standard input\&.
33 34 35 36 37
.PP
Invoke
\fBreplace\fR
in one of the following ways:
.sp
38 39 40
.if n \{\
.RS 4
.\}
41
.nf
42 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\fB [\fR\fB\fIfile_name\fR\fR\fB] \&.\&.\&.\fR
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 49 50 51
.PP
\fIfrom\fR
represents a string to look for and
\fIto\fR
52
represents its replacement\&. There can be one or more pairs of strings\&.
53 54 55
.PP
Use the
\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 60 61 62 63
.PP
If the
\fB\-\-\fR
option is not given,
\fBreplace\fR
64
reads the standard input and writes to the standard output\&.
65 66
.PP
\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 69 70 71
a
and
b
in the given files,
72
file1
73
and
74
file2:
75
.sp
76 77 78
.if n \{\
.RS 4
.\}
79
.nf
80
shell> \fBreplace a b b a \-\- file1 file2 \&.\&.\&.\fR
81
.fi
82
.if n \{\
83
.RE
84
.\}
85 86 87 88
.PP
The
\fBreplace\fR
program is used by
89 90
\fBmsql2mysql\fR\&. See
\fBmsql2mysql\fR(1)\&.
91 92
.PP
\fBreplace\fR
93
supports the following options\&.
94 95 96 97 98 99 100 101 102
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
103 104 105
\fB\-?\fR,
\fB\-I\fR
.sp
106 107 108 109 110 111 112 113 114 115 116
Display a help message and exit\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
117 118
\fB\-#\fR\fB\fIdebug_options\fR\fR
.sp
119 120 121 122 123 124 125 126 127 128 129
Enable debugging\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
130 131
\fB\-s\fR
.sp
132 133 134 135 136 137 138 139 140 141 142
Silent mode\&. Print less information what the program does\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
143 144
\fB\-v\fR
.sp
145 146 147 148 149 150 151 152 153 154 155
Verbose mode\&. Print more information about what the program does\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
156 157
\fB\-V\fR
.sp
158 159
Display version information and exit\&.
.RE
160
.SH "COPYRIGHT"
161
.br
162
.PP
163
Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
164 165 166 167 168
.PP
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.
.PP
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.
.PP
169 170
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/.
.sp
171 172 173 174 175
.SH "SEE ALSO"
For more information, please refer to the MySQL Reference Manual,
which may already be installed locally and which is also available
online at http://dev.mysql.com/doc/.
.SH AUTHOR
176
Sun Microsystems, Inc. (http://www.mysql.com/).