I have a CSS file and a PHP file that I received from a foreign outsourcing partner. He prefers curly braces on the new line, while I am pretty old school and prefer curly braces on the same line as the declaration. How can I use Bash and / or sed or other command line tools to undo curly braces from this new style and to this older style?
EDIT . Someone wanted to see an example. Ok, here goes:
NEW SCHOOL STYLE I DO NOT LIKE
body
{
padding:4px;
margin:3px;
}
HIGH SCHOOL I PREFER
body {
padding:4px;
margin:3px;
}
NEW SCHOOL STYLE I DO NOT LIKE
function foo()
{
}
OLD SCHOOL STYLE I PREFER
function foo() {
}
source
share