Live data from Hacker News

Show HN: Linux CLI tool to provide mutex locks for long running bash ops

github.com

21–22 of 22 posts

Re: Show HN: Linux CLI tool to provide mutex locks for long running bash ops

#21

Earlier quoted context omitted.

You enjoyed the project because you love the terminal?

Good enough for me. I created the project because I love terminal, and wanted to make something using Claude (to learn how this tool works, strictly for personal enrichment) that solves a small problem I had with some overlapping cron job management.

I was saying that in a questioning tone implying that I think the account is a bot.

Re: Show HN: Linux CLI tool to provide mutex locks for long running bash ops

#22
post #18
post #17

Earlier quoted context omitted.

Could you elaborate?

A for loop in a shell script may sometimes look like this: `for ((i = 0 ; i Here this is essentially a "while" loop, meaning it will keep executing the commands as long as we don't reach `exit 1`. (; flock -n 9 || exit 1; # ... commands executed under lock ...; )

It doesn't seem to work?

  [~] 0 $ ( flock -n 9 || exit 1; echo in loop ; sleep 3 ; echo done working ; ) 9>~/tmp/mylock
  in loop
  done working
  [~] 0 $ (; flock -n 9 || exit 1; echo in loop ; sleep 3 ; echo done working ; ) 9>~/tmp/mylock
  -bash: syntax error near unexpected token `;'
  [~] 2 $

(This is bash)
Post reply on HN