Shell script for text replacement in a file.
Program enables replacement of text1 with text2 in file. Original file does not change and any changes are saved in file.n, where n is a number of new file (e.g. file.1, or file.2 if file.1 already exists).
1) Adding permissions to shell file:
Before running shell script, one needs to add execution permission:
$ chmod +x path/to/replace.sh
or
$ chmod 777 path/to/replace.sh
2) Running program:
To run the script, type the following command into a console:
$ ./replace.sh file text1 text2