My question may looks trivial... But it's because despite of my long experience of linux/unix/osx systems, I found myself lacking some basic notions.
I created a little bluetooth/arduino switch to control some appliances at home. It's a simple program like shown here http://www.tinkernut.com/2014/03/arduino-bluetooth-basics/
To enable or disable my switch, I do :
screen /dev/tty.HC-06-DevB
Then I type 0 or 1 in the console and my switch goes On or Off.
It works. Really, it's nothing difficult... Except that I don't know the principles behind the communication with the ressources located in /dev/ and I don't know how to start learning.
How can I have a simple commande to send 1 or 0 to this particular device? Something like:
echo 1 > screen /dev/tty.HC-06-DevB
I tried the command below, it doesn't work:
echo 1 > /dev/tty.HC-06-DevB
zsh: resource busy: /dev/tty.HC-06-DevB
Where to learn what are these "things" in /dev ?
PS : I am using OS X El Capitan.
echo
as root usingsudo
, but the redirection is handled by your shell and is unaffected – Michael Mrozek Jan 21 '16 at 22:05