Skip to content

Instantly share code, notes, and snippets.

@keiya
Created April 25, 2019 16:05
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 keiya/252a233fb3d3c08575317368c0b5a3fc to your computer and use it in GitHub Desktop.
Save keiya/252a233fb3d3c08575317368c0b5a3fc to your computer and use it in GitHub Desktop.
add a header for multiple files
#!/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