#!/bin/bash
(
flock -n 200 || exit 1
# commands executed under lock
sleep 3
echo "TEST"
) 200 > /home/nis/Scripts/lock.txt
Running this scrip gets me this error:
lock.sh: 7: lock.sh: Syntax error: word unexpected
I don't get why this happens. It works on my QNAP (Busybox)