mkfifo foo printf %s\\n bar | tee foo & tr -s '[:lower:]' '[:upper:]' <foo wait rm foo This is a working POSIX shell script of what I want to do:
printf %s\\n baris symbolic for an external program producing stdouttr -s '[:lower:]' '[:upper:]'is symbolic for another command that is supposed to receive the stdout and do something with itteeduplicates stdout to named pipe foo
And the output is as expected:
bar BAR Now I'd like to tidy up the code so it becomes external_program | my_function. Something like this:
f() ( mkfifo foo tee foo & tr -s '[:lower:]' '[:upper:]' <foo wait rm foo ) printf %s\\n bar | f But now there is no output at all.