If we split apart your command apart with the result of each command after the #
echo "foo" >&2 # echo "foo" and redirect to fd 2 (/dev/sdterr)
| #pipe stdout to
tee /dev/tty #both send stdout to file /dev/tty, which is terminal file that can output both stdout and stderr depending on what you pass to it (so you probably want /dev/stdout/ or /dev/stderr directly instead) and pass it along to the next pipe
| #pipe stdout to
logger -it "my_script"
So it depends on what you want to do (In the above foo gets redirected to stderr and nothing gets piped to tee
)
If you want to print foo to stderr and pass stdout to your script you can just do
echo "foo" | tee /dev/stderr | yourscirpt
Then tee
will print to stderr and foo will get piped as stdout to yourscript.