Reputation:
I am running hcitool application ($hcitool lescan). It detects all the bluetooth connected devices and shows the UUID for each. I press Ctrl+C when I see sensortag UUID B0:B4:48:BD:0F:83 and proceed. I want all this to be done using a .sh script. Please guide.
Upvotes: 0
Views: 2580
Reputation: 1
kill -INT process_ID
CTRL + C sends a SIGINT signal. kill also does the same. So, just pass the process ID to the above command.
To get the PID(process ID) type command : pgrep foo(suppose foo is your process)
Upvotes: 0
Reputation: 96266
grep
can quit immediately when a pattern is found:
hcitool lescan | grep -q 'B0:B4:48:BD:0F:83'
Upvotes: 2