I'm trying to run the airodum-ng command for 5 seconds then stop it and save the output to the network variable, so I can print the output to a whiptail gui. Unfortunately the command just never stops running does anyone know how to fix this. I tried the timeout method witch you can see here and i also tried to use sleep but no luck.
function aircrack() {
sudo airmon-ng check kill
name=($(sudo /usr/sbin/airmon-ng ))
sudo airmon-ng start ${name[5]}
name=($(sudo /usr/sbin/airmon-ng ))
**netwroks=($(timeout 5s sudo airodump-ng ${name[5]}))**
}