Skip to content

Instantly share code, notes, and snippets.

@magnific0
Last active July 10, 2023 18:36
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save magnific0/38ca675e69e16be5d6ee3e692a2a1c5f to your computer and use it in GitHub Desktop.
Save magnific0/38ca675e69e16be5d6ee3e692a2a1c5f to your computer and use it in GitHub Desktop.
Add a copyright license header to all CPP and H files
#!/bin/bash
read -r -d '' license <<-"EOF"
/* Copyright (c) 2010-2017, Delft University of Technology
* All rights reserved
*
* This file is part of the Tudat. Redistribution and use in source and
* binary forms, with or without modification, are permitted exclusively
* under the terms of the Modified BSD license. You should have received
* a copy of the license with this file. If not, please or visit:
* http://tudat.tudelft.nl/LICENSE.
*/
EOF
files=$(grep -rL "Copyright (c) 2010-2017, Delft University of Technology" * | grep "\.h\|\.cpp")
for f in $files
do
echo -e "$license" > temp
cat $f >> temp
mv temp $f
done
@thijstriemstra
Copy link

typo "rigths" ;)

@magnific0
Copy link
Author

typo "rigths" ;)

You're right :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment