SyntaxFix
Write A Post
Hire A Developer
Questions
Dumb solution: Connecting them through a named pipe (mkfifo). Then the command can be run second.
mkfifo pipe tee out.txt < pipe & command > pipe echo $?