-
Notifications
You must be signed in to change notification settings - Fork 13
Description
Dear Dave,
exactly what i'm looking for. But I don't understand how library mode should work:
If I define new or redefine existing functions in another script -- let say my_tsws -- this functions are known only in this context. But if one first source the tsws file in lib mode, declare functions and than call the tsws function, then in this function socat is forked with $0 as system script. In this moment, $0 will refer to my_tsws (and not to tsws as in standalone mode) and the intended things will not happen.
If I replace this $0 by ${BASH_SOURCE:-$0}, the tsws script is called by socat and the server is working. But obviously, this context has no knowledge of any new or redefinded functions of my_tsws.
A workaround would be to copy the tail of tsws into my_tsws. But that one can't call a library mode anymore. I may simply copy the file and append my needs, but this is lame, right?
Did I miss something?
Guido