Created
April 25, 2019 16:05
-
-
Save keiya/252a233fb3d3c08575317368c0b5a3fc to your computer and use it in GitHub Desktop.
add a header for multiple files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
content="" | |
for var in "$@" | |
do | |
if [[ -f "$var" ]]; then | |
echo "$content" | cat - ${var} > /tmp/add_header_out && mv /tmp/add_header_out ${var} | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment