In my script I need to randomly generate MAC addresses. The code below is from a larger script extracted, that's why the MAC address calculation is in a separate function.This works fine with the code below. Although when I execute the script it slows heavily down after a number of generated addresses.How can I improve the speed of generating valid MAC addresses?#!/bin/bashdevicesCSVMacAddress=55:2d:fa:07 # <- fake MAC address prefixdevicesCSVFile=''function mac_address() {    line=''    # ****************    # This line below when I calculate a random mac address ending seems to be slow    line+=$devicesCSVMacAddress$(od -txC -An -N2 /dev/random|tr \  :)    # ****************    devicesCSVFile+=$line'\n'    date}for (( i=0; i<100; i++ ))do    mac_address    echo $idoneecho -e $devicesCSVFile > devices.csvI used the od tool like it described in this answer: How to generate a valid random MAC Address with bash shell.
How to improve performance in generating MAC addresses with od?
shell;mac address;od
Use /dev/urandom. Use /dev/urandom. Use /dev/urandom. There is almost never a good reason to use /dev/random instead of /dev/urandom -- see http://www.2uo.de/myths-about-urandom/ -- and certainly not when you are going to publish the generated numbers all over the place./dev/random consumes entropy and blocks and waits if not enough of it is available. /dev/urandom never blocks.