Introduction
efc is a simple console program that replaces texts in files. The text to be exchanged can be transferred directly or it is in a file.
efcd [file] [oldcontent] [newcontent] (optional! [targetfile]) [options]
Parameter:
-
file: The source file(s), wildcard ('?' und '*') are allowed. You can pass a filename with both full and relative path.
-
oldcontent: The content to be exchanged.
When the parameter begins with "text:" or "t:", then the following text, after "text:" or "t:" exchanged.
When the parameter begins with "hex:" or "h:", then the following hexadecimal sequence, after "hex:" or "h:" exchanged. The hexadecimal sequence consists of two-digit, comma-separated hexadecimal numbers (e.g. "h:0D,0A").
If the parameter begins with "file:" or "f:", the content to be exchanged is in File whose name is after "file:" or "f:". A file name can be specified with either a complete or relative path.
-
newcontent: The content to be pasted. Can also be a file name whose contents are taken.
When the parameter begins with "text:" or "t:", the original text (the second parameter "oldcontent") is exchanged for the text following "text:" or "t:".
When the parameter begins with "hex:" or "h:", the original text (the second parameter "oldcontent") is exchanged for the hexadecimal sequence following "hex:" or "h:". The hexadecimal sequence consists of two-digit, comma-separated hexadecimal numbers (e.g. "h:0D,0A").
If the parameter begins with "file:" or "f:", the new content is in the File whose name is after "file:" or "f:". A file name can be specified with either a complete or relative path.
-
targetfile: Iif the parameter [file] represents a unique name, the resulting content can be saved to a new file. This file will only be overwritten if the parameter "-f" is passed.
-
options:
-
-r The subdirctorys are also searched recursively.
-
-v Indicates wheter an how often the content of the file has been changed.
-
-v+ Also displays the skipped files.
-
-s Stops in case of an error and waits for a keystroke.
-
-f If the parameter [targetfile] is set, an existing target file will only be overwritten if this parameter is passed.
-
-nop The processing is only simulated, no files are changed or created.
- Note
- The character '/' is expected as separator in the path specifications!
Example
License
ExchangeFileContents is free software:
GNU Affero General Public License Usage
You can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
Please review the following information to ensure the GNU Affero General Public License version 3 requirements will be met: https://www.gnu.org/licenses/agpl-3.0.en.html
This program 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 Affero General Public License for more details.