@@ -0,0 +1,1178 @@
+#!/usr/bin/env python3%0A%0Aimport argparse%0Aimport datetime%0Aimport multiprocessing%0Aimport subprocess%0Aimport sys%0Aimport time%0A%0Adef main():%0A%09#Parse arguments%0A%09parser = argparse.ArgumentParser(description='Prepend Files')%0A%09parser.add_argument('source', help='File to prepend to others.')%0A%09parser.add_argument('targets', nargs='*', help='A set of configurations to run.')%0A%09parser.add_argument('-s', '--skip-shebang', action='store_true',%0A%09%09help='In files with a shebang on the first line, insert the file after that line.')%0A%09arguments = parser.parse_args(sys.argv%5B1:%5D)%0A%0A%09#Read the source file%0A%09with open(arguments.source) as sourceFile:%0A%09%09sourceContents = sourceFile.readlines()%0A%0A%09#Write it to the targets%0A%09for target in arguments.targets:%0A%09%09with open(target) as targetFile:%0A%09%09%09targetContents = targetFile.readlines()%0A%0A%09%09if arguments.skip_shebang and len(targetContents) %3E 0 and targetContents%5B0%5D.startswith('#!'):%0A%09%09%09newContents = %5BtargetContents%5B0%5D%5D + sourceContents + targetContents%5B1:%5D%0A%09%09else:%0A%09%09%09newContents = sourceContents + targetContents%0A%0A%09%09with open(target, 'w') as targetFile:%0A%09%09%09targetFile.write(''.join(newContents))%0A%0A%09return 0%0A%0Aif __name__ == '__main__':%0A%09sys.exit(main())%0A

Prepend script, closing #3