Created
May 6, 2019 21:23
-
-
Save markasoftware/f0919b875362fd89e3e0c538943836da to your computer and use it in GitHub Desktop.
Generate a file with random contents, certain length, and fixed beginning and ending characters (phone number in file size).
This file contains 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/sh | |
if [ "$#" != 4 ] | |
then | |
echo 'USAGE: number.sh ~/my-phone-number 12065555555 o o' | |
exit 1 | |
fi | |
echo -n "$3" > "$1" | |
base32 < /dev/urandom | tr A-Z0-9\\n a-za-z | tr -d '=' | head -c $["$2"-2] >> "$1" | |
echo -n "$4" >> "$1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment