From 0d5410d97d36f6242f2b05e3a48808dd9d6dddbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20=C3=96hrstr=C3=B6m?= Date: Thu, 24 Aug 2023 20:58:53 +0200 Subject: [PATCH] Adjust command to work on macosx. --- scripts/generate_filesystem.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/generate_filesystem.sh b/scripts/generate_filesystem.sh index 6b1ad4b..2d76a29 100755 --- a/scripts/generate_filesystem.sh +++ b/scripts/generate_filesystem.sh @@ -8,7 +8,7 @@ maxdepth=5 rndname() { len=$((($RANDOM % 32)+1)); - cat /dev/urandom | tr -dc "[:alpha:]" | head -c $len + cat /dev/urandom | LC_ALL=C tr -dc 'a-zA-Z0-9' | fold -w $len | head -n 1 } createdir() @@ -25,7 +25,7 @@ createfs() then numsubdirs=$((($RANDOM % 3))); numfiles=$((($RANDOM % 32))); - + i=0 while [ $i -lt $numfiles ] do @@ -34,7 +34,7 @@ createfs() dd if=/dev/urandom of="$currdir/$name" bs=$blocksize count=$len > /dev/null 2>&1 ((i++)) done - + i=0 while [ $i -lt $numsubdirs ] do