Skip to content

Instantly share code, notes, and snippets.

@feloy
Created November 18, 2016 13:22
Show Gist options
  • Save feloy/e8bf73b80f2f5c7965814244316504c6 to your computer and use it in GitHub Desktop.
Save feloy/e8bf73b80f2f5c7965814244316504c6 to your computer and use it in GitHub Desktop.
Random patronym with login
#! /bin/bash
if [[ -n "$1" ]]; then
N=$1
else
N=1
fi
FEMININE_FIRSTS=feminine_firsts.txt
MASCULINE_FIRSTS=masculine_firsts.txt
LASTS=lasts.txt
for i in $(seq $N); do
N=$(cat $FEMININE_FIRSTS $MASCULINE_FIRSTS | shuf -n 1)
P=$(shuf -n 1 $LASTS)
echo "$N,$P,$(echo ${N,,} | head -c 1)${P,,}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment