3 ms·
Wouldn't it work if you did 2>&1 as part of the redirect?
by wglb 2y ago
Wouldn't it work if you did
2>&1
as part of the redirect?
- rocqua 2y agoYes, but if someone only just learned about less and piping, they probably won't know about fd 2 being stderr, fd based redirection, and hence don't understand it at all
- professoretc 2y agoFor my beginner programming class, I have them use a script `compile` which handles compilation and linking, while also enabling enabling all the warnings/errors I think are helpful, and also doing the above redirection. An absolute beginner doesn't gain anything from invoking `g++` directly.
- paulddraper 2y agoYes, but most beginners have never seen (or remember) that.
- wglb 2y agoKnowing about some of these shell bits would be useful for someone learning about C++.
- jprete 2y agoI know about that mechanism but I use it so infrequently that I have to look it up every time; the syntax doesn't really match anything else I know. It's also hard to look up because even the right search terms fetch a lot of nearby-concept results so I have to dig for the exact idea. (Probably this is an ideal LLM question though!)
- LoganDark 2y agoThere used to be a search engine called SymbolHound whose entire shtick was to not ignore special characters in the query. Unfortunately it looks like it's gone now, seemingly without so much as a farewell. Their posts just stopped.
- wglb 2y agoIt seems to be part of my muscle memory. I likely got that memorized from the time that I wrote a shell (/bin/sh) tutorial back in the day.