-
-
Save arn-ob/85e36c89b907fabd72b3ab318dcc63de to your computer and use it in GitHub Desktop.
Little bash script to create a CSV file containing many thousands of fake (but valid) URLs.
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 | |
| # Each 'run' generates 10 unique URLs, so if RUNS=10 you'll get 100 lines out. | |
| # Requires `gpw` to be installed, as a source for nice, random strings. | |
| FILE=large-test.csv | |
| RUNS=10000 | |
| if test -f "$FILE"; then | |
| truncate -s 0 $FILE | |
| else | |
| touch $FILE | |
| fi | |
| for (( i=1; i <= $RUNS; i++)); do | |
| string=$(gpw 1 25) | |
| echo "http://$string.co.uk" >> $FILE | |
| echo "http://$string.net" >> $FILE | |
| echo "http://$string.org" >> $FILE | |
| echo "http://$string.org.uk" >> $FILE | |
| echo "http://$string.eu" >> $FILE | |
| echo "http://$string.ie" >> $FILE | |
| echo "http://$string.irish" >> $FILE | |
| echo "http://$string.cymru" >> $FILE | |
| echo "http://$string.wales" >> $FILE | |
| echo "http://$string.scot" >> $FILE | |
| if [[ $(( $i % 100 )) -eq "0" ]]; then | |
| echo "Done $(wc -l $FILE | cut -d " " -f 1) lines." | |
| fi | |
| done | |
| echo | |
| echo "$(wc -l $FILE | cut -d " " -f 1) lines." | |
| echo | |
| ls -gh $FILE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment