Useful sed(1) regular expressions
Source code cleanup:
sed -i '' -E s/\ \ /\ /g *.c *.h
sed -i '' -E s/^\ \ \ \ \ \ \ \ /\ /g *.c *.h
sed -i '' -E s/\ \ \ \ \ \ \ \ \ /\ \ /g *.c *.h
sed -i '' -E s/\ +\$//g *.c *.hSubsistitue / with \/:
sed -i '' -E s/\\\//\\\\\\\\\\\\\\\//g
Just joking… No, nobody will ever try to use the above command :-)
在线阅读本文并参与讨论 delphij's Chaos https://blog.delphij.net/posts/2004/06/useful-sed1-reg/