2009-09-16 14:03:18 +02:00
'\" t
2009-05-25 11:59:47 +02:00
. \"
2020-05-15 17:35:47 +02:00
.TH "\FBREPLACE\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
2009-09-16 14:03:18 +02:00
. \" -----------------------------------------------------------------
. \" * set default formatting
. \" -----------------------------------------------------------------
2009-05-25 11:59:47 +02:00
. \" disable hyphenation
.nh
. \" disable justification (adjust text to left margin only)
.ad l
2009-09-16 14:03:18 +02:00
. \" -----------------------------------------------------------------
. \" * MAIN CONTENT STARTS HERE *
. \" -----------------------------------------------------------------
. \" replace utility
. \" string replacement: replace utility
2009-05-25 11:59:47 +02:00
.SH "NAME"
replace \- a string\- replacement utility
.SH "SYNOPSIS"
2009-09-16 14:03:18 +02:00
.HP \w '\fBreplace\ \fR \fB \fI arguments\fR\fR\ 'u
2009-05-25 11:59:47 +02:00
\fB replace \fR \fB \fI arguments\fR \fR
.SH "DESCRIPTION"
.PP
The
\fB replace\fR
2009-09-16 14:03:18 +02:00
utility program changes strings in place in files or on the standard input\& .
2009-05-25 11:59:47 +02:00
.PP
Invoke
\fB replace\fR
in one of the following ways:
.sp
2009-09-16 14:03:18 +02:00
.if n \{ \
.RS 4
. \}
2009-05-25 11:59:47 +02:00
.nf
2009-09-16 14:03:18 +02:00
shell> \fB replace \fR \fB \fI from\fR \fR \fB \fR \fB \fI to\fR \fR \fB [\fR \fB \fI from\fR \fR \fB \fR \fB \fI to\fR \fR \fB ] \& .\& .\& . \- \- \fR \fB \fI file_name\fR \fR \fB [\fR \fB \fI file_name\fR \fR \fB ] \& .\& .\& .\fR
shell> \fB replace \fR \fB \fI from\fR \fR \fB \fR \fB \fI to\fR \fR \fB [\fR \fB \fI from\fR \fR \fB \fR \fB \fI to\fR \fR \fB ] \& .\& .\& . < \fR \fB \fI file_name\fR \fR
2009-05-25 11:59:47 +02:00
.fi
2009-09-16 14:03:18 +02:00
.if n \{ \
2009-05-25 11:59:47 +02:00
.RE
2009-09-16 14:03:18 +02:00
. \}
2009-05-25 11:59:47 +02:00
.PP
\fI from\fR
represents a string to look for and
\fI to\fR
2009-09-16 14:03:18 +02:00
represents its replacement\& . There can be one or more pairs of strings\& .
2009-05-25 11:59:47 +02:00
.PP
Use the
\fB \- \- \fR
2009-09-16 14:03:18 +02:00
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\& .
2009-05-25 11:59:47 +02:00
\fI replace\fR
2009-09-16 14:03:18 +02:00
prints a message indicating which of the input files it actually modifies\& .
2009-05-25 11:59:47 +02:00
.PP
If the
\fB \- \- \fR
option is not given,
\fB replace\fR
2009-09-16 14:03:18 +02:00
reads the standard input and writes to the standard output\& .
2009-05-25 11:59:47 +02:00
.PP
\fB replace\fR
2009-09-16 14:03:18 +02:00
uses a finite state machine to match longer strings first\& . It can be used to swap strings\& . For example, the following command swaps
2009-05-25 11:59:47 +02:00
a
and
b
in the given files,
2009-09-16 14:03:18 +02:00
file1
2009-05-25 11:59:47 +02:00
and
2009-09-16 14:03:18 +02:00
file2:
2009-05-25 11:59:47 +02:00
.sp
2009-09-16 14:03:18 +02:00
.if n \{ \
.RS 4
. \}
2009-05-25 11:59:47 +02:00
.nf
2009-09-16 14:03:18 +02:00
shell> \fB replace a b b a \- \- file1 file2 \& .\& .\& .\fR
2009-05-25 11:59:47 +02:00
.fi
2009-09-16 14:03:18 +02:00
.if n \{ \
2009-05-25 11:59:47 +02:00
.RE
2009-09-16 14:03:18 +02:00
. \}
2009-05-25 11:59:47 +02:00
.PP
The
\fB replace\fR
program is used by
2009-09-16 14:03:18 +02:00
\fB msql2mysql\fR \& . See
\fB msql2mysql\fR (1)\& .
2009-05-25 11:59:47 +02:00
.PP
\fB replace\fR
2010-04-28 15:06:11 +02:00
supports the following options\& .
2009-09-16 14:03:18 +02:00
.sp
.RS 4
.ie n \{ \
\h '-04'\(bu \h '+03'\c
. \}
.el \{ \
.sp -1
.IP \(bu 2 .3
. \}
2009-05-25 11:59:47 +02:00
\fB \- ?\fR ,
\fB \- I\fR
.sp
2009-09-16 14:03:18 +02:00
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
. \}
2009-05-25 11:59:47 +02:00
\fB \- #\fR \fB \fI debug_options\fR \fR
.sp
2009-09-16 14:03:18 +02:00
Enable debugging\& .
.RE
.sp
.RS 4
.ie n \{ \
\h '-04'\(bu \h '+03'\c
. \}
.el \{ \
.sp -1
.IP \(bu 2 .3
. \}
2009-05-25 11:59:47 +02:00
\fB \- s\fR
.sp
2009-09-16 14:03:18 +02:00
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
. \}
2009-05-25 11:59:47 +02:00
\fB \- v\fR
.sp
2009-09-16 14:03:18 +02:00
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
. \}
2009-05-25 11:59:47 +02:00
\fB \- V\fR
.sp
2009-09-16 14:03:18 +02:00
Display version information and exit\& .
.RE
2009-05-25 11:59:47 +02:00
.SH "COPYRIGHT"
2009-09-16 14:03:18 +02:00
.br
2009-05-25 11:59:47 +02:00
.PP
2020-05-15 17:35:47 +02:00
Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2020 MariaDB Foundation
2009-05-25 11:59:47 +02:00
.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
2019-05-11 20:29:06 +02:00
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-1335 USA or see http://www.gnu.org/licenses/.
2009-09-16 14:03:18 +02:00
.sp
2009-05-25 11:59:47 +02:00
.SH "SEE ALSO"
2015-09-09 14:32:52 +02:00
For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
2009-05-25 11:59:47 +02:00
.SH AUTHOR
2015-09-09 14:32:52 +02:00
MariaDB Foundation (http://www.mariadb.org/).