Python script which creates a sed-like perl script that tries to replace custom newcommands by their definition