1

I have the following two invocations of a function in bash, which I'm piping to another function which captures the error output:

>&2 log_stdout | log_err

log_stdout >&2 | log_err

Is there any semantic difference between the two?

Edit: The suggested duplicate, while having an awesome community wiki, does not provide an answer to this specific question.

JohnEye
  • 417
  • Regarding your edit, I reckoned “They can appear anywhere within a simple command or may follow a command.” in the suggested duplicate did answer your question. – Stephen Kitt Mar 07 '17 at 22:01
  • @StephenKitt: Yes, that just didn't seem clear enough for me at the time, but thanks for pointing it out. – JohnEye Mar 08 '17 at 12:52

1 Answers1

3

They are equivalent.

The relative order of redirections may matter, but their position with respect to the command does not.

user2233709
  • 1,669