I want to when I plug an usb device to my laptop, a script will be run just one time. So I use the udev rules system in UBUNTU 12.04. I wrote the below udev rule:
ACTION=="add", SUBSYSTEMS=="usb", RUN+="/home/hossein/Desktop/test".
The below commands is written in the test script:
#!/bin/bash echo Hello >> /home/hossein/Desktop/file.txt
my problem is that when I attach a usb device, about 13 times the word Hello is written in the file.txt while I just expect one time occurrence of Hello. What's the reason?