A random 128-bit UUID obtained from /proc/sys/kernel/random/uuid works
too but is Linux-specific and requires the proc(5) pseudo-filesystem to
be mounted at /proc.
# Sample (random) message
sample_message() {
+ local date="$(date +"%s.%N")"
cat <<-EOF
From: <sender@example.net>
To: <recipient@example.net>
- Date: $(date -R)
- Message-ID: <$(< /proc/sys/kernel/random/uuid)@example.net>
+ Date: $(date -R -d@"$date")
+ Message-ID: <$date@example.net>
EOF
local len="$(shuf -i1-4096 -n1)"