Advanced bash/shell scripting question - I cannot seem to do the
correct incantation with /usr/bin/flock to make it work in a bash
block. Can any Master of the Bash give me a hint?

In other words, I am trying to put into to use the example in man
flock, where it says:'second form is convenient inside shell scripts'.


 # this does what I expect, and if I attempt
 # to obtain a second lock it fails
 $ flock -n /tmp/lockmyprecious sleep 60

 # this does not seem to work
 $ (flock -n 200; echo gotlock; sleep 60)200>/tmp/lockmyprecious

There is a bash script where I want to wrap a lock around a large-ish
code block that I don't want to split off to a separate script.

hints?


m
-- 
 [EMAIL PROTECTED]
 [EMAIL PROTECTED] -- School Server Architect
 - ask interesting questions
 - don't get distracted with shiny stuff - working code first
 - http://wiki.laptop.org/go/User:Martinlanghoff
_______________________________________________
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel

Reply via email to