I am using following command to replace yyyymmdd
to YYYYMMDDHH24MISS
in my file:
sed -e 's/\('yyyymmdd'\)/\('YYYYMMDDHH24MISS'\)/g' filename
After I run the command in PuTTY, it displays the file with replaced values, but they do not reflect if I more
the file.
I tried using -i
, but it says
sed: illegal option -- i
Can someone please suggest how do I replace the given code in multiple files and save them?
-i
option? Can you please update your question with the line that contains the-i
flag please? – tachomi Feb 04 '16 at 16:15-i
option is not POSIX conformant: what system / flavor of Unix is thesed
command being run on (Linux? BSD? OSX?) – steeldriver Feb 04 '16 at 16:27\(
or the'
or any of that. Your command can be written simply assed -e 's/yyyymmdd/YYYYMMDDHH24MISS/g
(you can even omit the-e
on some systems). – terdon Feb 04 '16 at 16:53