Skip to content

Commit

Permalink
Prefer tr over unportable dd lcase
Browse files Browse the repository at this point in the history
  • Loading branch information
kulp committed Sep 2, 2021
1 parent ee959cb commit 9d46e68
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/random.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
count=1024
str=$(LC_ALL=C tr -dc "[:xdigit:]" < /dev/urandom | dd conv=lcase | head -c$((count * 8)))
str=$(LC_ALL=C tr -dc "[:xdigit:]" < /dev/urandom | tr [:upper:] [:lower:] | head -c$((count * 8)))
for i in `seq 0 $((count - 1))`; do
r=$RANDOM
f=${str:$((i * 8 + 0)):1}
Expand Down

0 comments on commit 9d46e68

Please sign in to comment.