Create Pseudo Files (with Color-Tags), macOS

Create thousends of Pseudo-Files with selected Names (NAME) and Random-Sizes. And Color-Tags (xattr), only macOS.

#!/bin/sh

counter=1
while [ $counter -le 1 ]
do
NAME=`awk -v min=10000 -v max=99999 'BEGIN{srand(); print int(min+rand()*(max-min+1))}'`
VAR1=`awk -v min=16 -v max=64 'BEGIN{srand(); print int(min+rand()*(max-min+1))}'`
VAR2=`awk -v min=16 -v max=64 'BEGIN{srand(); print int(min+rand()*(max-min+1))}'`
VAR3=`awk -v min=16 -v max=64 'BEGIN{srand(); print int(min+rand()*(max-min+1))}'`
NUMBERS="0000000000000000000300000000000000000000000000000000000000000000
0000000000000000000400000000000000000000000000000000000000000000
0000000000000000000600000000000000000000000000000000000000000000
0000000000000000000900000000000000000000000000000000000000000000
0000000000000000000A00000000000000000000000000000000000000000000
0000000000000000000C00000000000000000000000000000000000000000000
0000000000000000000E00000000000000000000000000000000000000000000"

# main
dd if=/dev/zero of=$NAME count=1 bs=1 seek=$((1 * $VAR1 * $VAR2 * $VAR3 - 1)) # File Sizes from VARs

# with color

number=($NUMBERS) # Read into array variable.
num_NUMBERS=${#number[*]} # Count how many elements.
xattr -wx com.apple.FinderInfo ${number[$((RANDOM%num_NUMBERS))]} $NAME # New Attributes for every file.

# show size optional
# du -h $NAME


done
exit