Join Nostr
2024-08-30 21:51:47 UTC

Annika Backstrooms on Nostr: `cmd > file.txt 2>&1` vs `cmd 2>&1 > file.txt` always tripped me up: the first form ...

`cmd > file.txt 2>&1` vs `cmd 2>&1 > file.txt` always tripped me up: the first form is what I usually want (send both to file.txt) but always felt backwards to my brain.

Prompted by Julia, I read up on https://www.gnu.org/software/bash/manual/html_node/Redirections.html and tried to understand why the first incantation sends both outputs to file.txt

Also TIL zsh "MULTIOS" which sends stdout to your pipe even if you've redirected to a file.