UPPER.txt file, I need to substitute
ORANGE with non-capital
orange. I also need to keep the old file
UPPER.txt as it was, and a generate a new file
lower.txt. I am using the following commands:
sed 's/APPLE/apple/g' UPPER.txt > lower.txt sed 's/ORANGE/orange/g' UPPER.txt > lower.txt
But the problem is that after I run the above command
lower.txt become the same containing non-capital items. I want the
UPPER.txt to remain as it was originally.
How can I keep a backup of the original file after using sed?
Since I want to use this command in C++ using
system(command) to operate on the files, I would like all the commands to be written in one line then I can pass it as string to system command.