Code Monkey home page Code Monkey logo

Comments (7)

evangreen avatar evangreen commented on August 18, 2024

Yes, we should do this. The fancy sed expression I created worked well for the .c, .h, .S, and .ck files, but didn't catch the Makefiles.

from os.

jonalmeida avatar jonalmeida commented on August 18, 2024

I can try to put a patch together for this if you'd like.

from os.

evangreen avatar evangreen commented on August 18, 2024

Yes, go ahead Jonathan.

from os.

evangreen avatar evangreen commented on August 18, 2024

@jonalmeida Any progress here?

from os.

jonalmeida avatar jonalmeida commented on August 18, 2024

@evangreen Sorry this took long. I ran into some issues but I finally managed to resolve them. I've created #52 with my patch. Here are the comments in my patch that someone might find useful in the future..


Since I'm using Mac OS X (10.11), I hard to learn the hard way that BSD and GNU sed treated newlines differently. I read about the difference between GNU and BSD sed thanks to a very helpful SO comment that explained the differences and solution.

The solution was to simply use GNU sed instead (pun intended) by installing it via Homebrew:

brew install gnu-sed

Using that along with find, allowed me to search through every file and call gsed:

find ./ -type f -exec sed -i -e 's/foo/bar/g' {} \;

Eventually I ended up with this regex:

find ./ -type f -exec gsed -i "s/Copyright (c) 2012 Minoca Corp. All Rights Reserved/Copyright (c) 2012 Minoca Corp.\n#\n#    This file is licensed under the terms of the GNU General Public License\n#    version 3. Alternative licensing terms are available. Contact\n#    [email protected] for details. See the LICENSE file at the root of this\n#    project for complete licensing information.\n#/" {} \;

Notes: I've replaced the copyright for each year with the GPL eqivalent with the same. i.e Copyright for 2012 gets a GPL since 2012, etc.

from os.

evangreen avatar evangreen commented on August 18, 2024

Awesome. This change looks good, I will merge it in soon. Thanks!

from os.

jonalmeida avatar jonalmeida commented on August 18, 2024

Closing. See #52 for details.

from os.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.