I need a timer which will work with milliseconds. I tried to use sleep 0.1 command in a script, but I see this error message:
sleep 0.1
syntax error: invali
Make sure you're running your script in Bash, not /bin/sh. For example:
/bin/sh
#!/usr/bin/env bash sleep 0.1
In other words, try to specify the shell explicitly. Then run either by: ./foo.sh or bash foo.sh.
./foo.sh
bash foo.sh
In case, sleep is an alias or a function, try replacing sleep with \sleep.
sleep
\sleep