bash - Reading realtime output from airodump-ng -


when execute command airodump-ng mon0 >> output.txt , output.txt empty. need able run airodump-ng mon0 , after 5 seconds stop command , have access output. thoughts should begin look? using bash.

start command background process, sleep 5 seconds, kill background process. may need redirect different stream stdout capturing output in file. this thread mentions stderr (which fd 2). can't verify here, can check descriptor number strace. command should show this:

$ strace airodump-ng mon0 2>&1 | grep ^write ... write(2, "...

the number in write statement file descriptor airodump-ng writes to.

the script might (assuming stderr needs redirected):

#!/bin/bash  { airodump-ng mon0 2>> output.txt; } & pid=$!  sleep 5  kill -term $pid cat output.txt 

Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

html - Unable to style the color of bullets in a list -

c# - must be a non-abstract type with a public parameterless constructor in redis -