In my experience it makes even more sense in functional programming languages, not less, since they usually also have more powerful type systems that help with actually representing parsed vs unparsed data.
#!/bin/bash
mac="\\x${1//:/\\x}"
wol="\xFF\xFF\xFF\xFF\xFF\xFF"
for i in {1..16}; do wol+="$mac"; done
printf "$wol" > "/dev/udp/$2/9"