I have this:
ql_remove_locks(){
local pid="$$";
declare -i count=0;
ql_pid="$pid" ql_node_ls_all | while read line; do
count=$((count+1));
echo "count: $count";
echo "deleting lock: $line";
rm -rf "$line";
done;
echo "quicklock: $count lock(s) removed."
}
I am getting this output:
count: 1
deleting lock: /Users/alexamil/.quicklock/locks/a.lock
quicklock: 0 lock(s) removed.
I have tried so many things, still 0 always gets logged:
quicklock: 0 lock(s) removed.
Why is the count 0 instead of 1 in the echo statement?