4 ms·
Wow, I've written way more shell code than people should and I didn't know you could write this toolname < textfile as < textfile toolname
by tym0 4y ago
Wow, I've written way more shell code than people should and I didn't know you could write this
toolname < textfile
as
< textfile toolname
- dvfjsdhgfv 4y agoMy theory is that it's because most people using Bash are not interested in it per se (in the way, say, many C programmers are interested in its intrinsics) but in solving a problem, and Bash can let you solve it in several different ways. So you solve the problem and maybe don't use Bash for a few days and then again you need to solve another problem, maybe completely different. Personally I rediscover certain aspects of Bash every few years just because of that. I'm not going to read the whole Bash manual from the beginning till the end in the same way I read K&R because it makes no sense - I can solve my problem in 2 minutes and get on with my main work.
- tpoacher 4y agoYou say that, but the bash manual is an absolute delight. (unironically). Super clear, comprehensive but straight to the point, everything you might want to know is there in logical headings. I struggled with bad bash code I'd pick up on websites and online tutorials, until I decided to just do `man bash` one day. Went from 10% to 99.999% bash proficient overnight. Whenever I need to check something related to bash these days, 99% of the time the man page resolves my query within seconds. Occasionally you have to do `help [TAB]` and get the help for the specific built in instead. The bits not covered by the above two points are extremely rare.