Skip to content

Instantly share code, notes, and snippets.

@siddontang
Created April 2, 2016 07:43
Show Gist options
  • Select an option

  • Save siddontang/27a1dd0fce5b4aae456d42fe3f59e5b8 to your computer and use it in GitHub Desktop.

Select an option

Save siddontang/27a1dd0fce5b4aae456d42fe3f59e5b8 to your computer and use it in GitHub Desktop.
#!/bin/bash
header="// Copyright 2016 PingCAP, Inc. \
\n// \
\n// Licensed under the Apache License, Version 2.0 (the \"License\"); \
\n// you may not use this file except in compliance with the License. \
\n// You may obtain a copy of the License at \
\n// \
\n// http://www.apache.org/licenses/LICENSE-2.0 \
\n// \
\n// Unless required by applicable law or agreed to in writing, software \
\n// distributed under the License is distributed on an \"AS IS\" BASIS, \
\n// See the License for the specific language governing permissions and \
\n// limitations under the License. \
\n"
find . -name "*.rs" -exec gsed -i -e "1i$header" {} +
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment