In a bash script I would like to execute multiple commands while keeping a file locked with setlock. Setlock however only supports the following usage:
setlock [-NnXx] [lock file] [command]
Is there a way to wrap multiple commands together besides using a separated script?