Search code examples
bashprocess-substitutiondot-source

What does this notation mean in bash?


I am pretty sure this will be a duplicate, because I have seen it sometimes at other places, but I do not remember where and I also (obviously) do not know how it is called.

In an other SO post, there is this piece of code (bash):

obj(){
    . <(sed "s/obj/$1/g" obj.class)
}

What does . < do ? If it has a name, what is it ?


Solution

  • Source . [Docs]

    Read and execute commands from the filename argument in the current shell context.

    source is a synonym for dot/period . in bash, but not in POSIX sh, so for maximum compatibility use the period.


    Process Substitution < () [Docs]

    Process substitution allows a process’s input or output to be referred to using a filename.