Advertisement
arter97

Untitled

Mar 27th, 2018
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.42 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. while [[ $# -gt 0 ]]; do
  4.   if sed '/#include/q' "$1" | grep -qi copyright; then
  5.     LINE=$(sed '/#include/q' "$1" | grep -in copyright | cut -d : -f 1 | tail -n1)
  6.   else
  7.     LINE=$(sed '/#include/q' "$1" | grep -in 'GPL\|GNU' | cut -d : -f 1 | tail -n1)
  8.     LINE=$(($LINE - 1))
  9.     sed -i -e "${LINE}a\
  10. \ *
  11. " "$1"
  12.   fi
  13.  
  14.   sed -i -e "${LINE}a\
  15. \ * Copyright (C) 2018 Razer Inc.
  16. " "$1"
  17.   shift
  18. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement