Putting commands in a file
Put these lines in a script file named
Then run it like this:
$ sed -i -f script.sed baconFile
Making a standalone sed script
if you want it to be a single executable then do this:
sed -i '
Put the above lines into a file called
script.bash, make it executable (
chmod +x script.bash, and run it like this:
$ script.bash baconFile
Creating the script file
You can use this method to make the file I mentioned above.
$ cat > script.bash <<EOF
This will make the script file. You can confirm using this command:
$ cat script.bash