Skip to content

Instantly share code, notes, and snippets.

@stefanofiorentino
Last active January 23, 2019 11:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stefanofiorentino/91ac92bd571d8d380fcd452922480ffd to your computer and use it in GitHub Desktop.
Save stefanofiorentino/91ac92bd571d8d380fcd452922480ffd to your computer and use it in GitHub Desktop.
rename all cpp files to hpp extension
#!/bin/bash
find . -name "*.cpp" | grep "cpp$" | sed 's/cpp$//g' | xargs -r -n1 -I {} echo mv {}cpp {}hpp
find . -name "*.hpp" | xargs -r -n1 -I {} sed -i '1s;^;#pragma once\n;' {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment