Tag Archives: bash

how to timeout a process in the shell

tatico@tortuguita:~$ timeout -s SIGKILL 5 sleep 10
or better:
tatico@tortuguita:~$ time timeout -s SIGKILL 5 sleep 10

usefull with tcpdump, tail -f and all stuff that could stay waiting forever.

mac address lookup with bash

This script relies on wireshark, it has to be installed

#!/bin/bash
#macaddresslookup.sh
if [[ ! $1 ]]
then echo "Usage: $0 "
exit 1
else
mac=$1
#echo ${mac:0:8}
oui=${mac:0:8}
grep -i $oui /usr/share/wireshark/manuf
fi

You can also download the file:
http://anonsvn.wireshark.org/wireshark/trunk/manuf