Created
April 6, 2018 10:32
-
-
Save belenaj/cd44072a54df819eb8720e06aaa9514a to your computer and use it in GitHub Desktop.
Creates a XML Dummy File of with a specific number of rows in the body. Includes header and footer
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 | |
| iterations=100000 | |
| fileName=myFile.xml | |
| # header | |
| echo "<?xml version="1.0" encoding="UTF-8"?> | |
| <file> | |
| <veryBig> | |
| <wantedTag>Hello World</wantedTag> | |
| <anotherWantedTag>Hello All</anotherWantedTag>" >> $fileName; | |
| # body | |
| for ((i=1;i<=$iterations;i++)) ; | |
| do echo "<otherData>many Rows</otherData>"; | |
| done >> $fileName | |
| # tail | |
| echo "</veryBig> | |
| </file>" >> $fileName; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment