Skip to content

About Library Mode #4

@gjaekel

Description

@gjaekel

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions