Created
March 3, 2020 22:29
-
-
Save karancode/017f751a71993bedead78e2872985f2c to your computer and use it in GitHub Desktop.
Duplicate all the files in a directory with different name (appended string, etc.)
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
| # Let's say you've .yaml.j2 files in a directory and | |
| # you want to make copy for each file, for ex: | |
| # files you have : config1.yml.j2 config2.yml.j2 porperties1.yml.j2 setup.yml.j2 | |
| # files you want : config1.yml.j2 config1_new.yml.j2 config2.yml.j2 config2_new.yml.j2 porperties1.yml.j2 porperties1_new.yml.j2 setup.yml.j2 setup_new.yml.j2 | |
| for filename in *.yml.j2; do mv $filename ${filename%.yaml.j2}_new.yml.j2; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment