This does not work, because the bourne shell does not support handling null bytes. Bastards.

sh <<"EOF"
hostname="${1:-akisha}"

# Strip out comments
arptab() {
  tab="$(printf "\t")"
  sed -e 's/#.*$//g; s/'"${tab}"'/  /g; /^ *$/d' arptab
}

host_to_mac() {
  host="${1}"
  line="$(arptab | grep -i "${host}" | head -n 1)"
  mac="${line%% *}"
  echo "${mac}" | tr 'a-f' 'A-F'
}

hex_to_oct() {
  hex="$(echo "${1}" | tr 'a-f' 'A-F')"
  echo "ibase=16; obase=8; ${hex}" | bc
}

hex_to_byte() {
  oct="$(hex_to_oct "${1}")"
  printf ' ' | tr ' ' "\\${oct}"
}

mac_to_bytes() {
  for octet in $(printf "${1}" | tr ":" " ")
  do
    hex_to_byte "${octet}"
  done
}

packet() {
  mac="${1}"

  packet="FF:FF:FF:FF:FF:FF"
  packet="${packet}:${mac}:${mac}:${mac}:${mac}"
  packet="${packet}:${mac}:${mac}:${mac}:${mac}"
  packet="${packet}:${mac}:${mac}:${mac}:${mac}"
  packet="${packet}:${mac}:${mac}:${mac}:${mac}"

  mac_to_bytes "${packet}"

}

printf "$(packet "$(host_to_mac "${hostname}")")" | nc -vvbu 172.16.44.255 1

EOF


sh <<"EOF"
i=0
while [ $i -lt 256 ]
do
  oct="$(echo "obase=8; ${i}" | bc)"
  printf ' ' | tr ' ' "\\${oct}"
  i=$(( $i + 1 ))
done | hd
EOF


  mac="$(host_to_mac "${1}")"

PHP Warning

Warning: "preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead"

Warning: "preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead:"

Warning: "preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead"

Warning: "preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead"

Warning: "preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead"

Warning: "preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead"

Warning: "preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead"

Warning: "preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead"

Warning: "preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead:"