Shell Pipe – How to Feed Source Command with a Pipe

pipeshell

Previously I used source command like this:

source file_name

But what I'm trying to do is this:

echo something | source

Which doesn't work.

Best Answer

Since source (or .) takes a file as argument, you could try process substitution:

source <(echo something)
Related Question