1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#!/bin/sh SPDX="/* SPDX-License-Identifier: copyleft-next-0.3.1 */" for f in "$@" do if [ "$(head -1 "$f")" != "${SPDX}" ] then sed -i "1i${SPDX}\n" "$f" fi if ! grep 'Copyright' "$f" > /dev/null then echo "Missing copyright info in $f" fi done