- Install Tidy
- Run it with the
-clean
option
tidy -clean INFILE > OUTFILE
-clean
optiontidy -clean INFILE > OUTFILE
Perfect for those "the file has been edited but I don’t remember intentionally changing something" moments, or just those "where was I?" moments. The line of the last edit is at the special mark dot (.), so you can get to it with backtick dot (`.)
, or apostrophe dot ('.)
.
Type :help mark-motion
for details.
sed -i -- 's/PATTERN/REPLACEMENT/g' *
-i
means "in-place"--
tells sed
that this is the end of the options. Otherwise, it might interpret hyphens in the script as options