I would like to do:
cat a.txt |\
awk '{
if ($1>0) {
print $0
} else {
print $0 | "cat 1>&3"
}
}' 1>(awk '{print $0"positive"}') 3>(awk '{[print $0"zero or negative"}')
The idea is that I want to process both outputs separately from the same command.
Is that possible? How? Is that NOT recommended?
Thank you!
2 processes and the file is read twice and it's probably buffered. Your example would contain the same number of reads but 3 processes.