The initial approach was: #518 and #519 But this gets way too complex. We agreed to instead instruct the user in documentation to write a shell scripts. This would be much less painful. So in documentation we should describe how to do that.