Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • 2
    That might run, but it won't be very useful. The parts of a pipeline run in subshells, and the point of source is to run in the same shell. E.g. if you try echo foo=bar | source /dev/stdin, you can check that foo does not get set. You might try with lastpipe set, but it doesn't work in interactive shells (though I'm not sure if that's a problem in the context here) Commented Oct 31, 2022 at 21:17
  • Odd I tested it just now, worked Commented Oct 31, 2022 at 21:18
  • 1
    ok, right, it does work in zsh. In Bash you'll need lastpipe. Commented Oct 31, 2022 at 21:19
  • 1
    source is not portable, it is a bash alias for the standard POSIX . command (change source .x to . .x) Commented Oct 31, 2022 at 22:03