Skip to content

Instantly share code, notes, and snippets.

@belenaj
Created April 6, 2018 10:32
Show Gist options
  • Select an option

  • Save belenaj/cd44072a54df819eb8720e06aaa9514a to your computer and use it in GitHub Desktop.

Select an option

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
#!/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