Created
January 28, 2021 00:01
-
-
Save djeikyb/d726d93b6d8ab6b4e3ee7ac3095d1d31 to your computer and use it in GitHub Desktop.
perl oneliner: insert line at beginning of a bunch of 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
for f in tables/*.sql; do echo "$f"; perl -0777 -pi -e 's/^/use my_database_name;\n\n/' "$f"; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment