Syntax error near unexpected token `('
I would like to create a bash script that can detect any mouse movement and then execute a command.
detect_mouse_mvt.sh
/home/andy/bin/detect_mouse_mvt.sh: line 4: syntax error near unexpected token `('
/home/andy/bin/detect_mouse_mvt.sh: line 4: `fh = file('/dev/input/mice')'
#!/bin/bash
#
#
fh = file('/dev/input/mice')
while True:
fh.read(3)
print 'Mouse moved!'
I would like to create a bash script that can detect any mouse movement and then execute a command.
detect_mouse_mvt.sh
/home/andy/bin/detect_mouse_mvt.sh: line 4: syntax error near unexpected token `('
/home/andy/bin/detect_mouse_mvt.sh: line 4: `fh = file('/dev/input/mice')'
#!/bin/bash
#
#
fh = file('/dev/input/mice')
while True:
fh.read(3)
print 'Mouse moved!'