3 ms·
While I agree with the larger sentiment I think you’re making (I also make it a habit to peruse the manual just to see what is available), how often do you rere
by latexr 2y ago
While I agree with the larger sentiment I think you’re making (I also make it a habit to peruse the manual just to see what is available), how often do you reread the manual, especially for your shell? I knew about associative arrays in bash, but not by reading the manual as those were introduced in v4 and I’ve been using bash for longer than that.
- teddyh 2y agoYou should probably read the release notes for new major versions. Also, anytime you think “I wish there was <feature> available in this program”, you should probably double-check if such a feature has appeared since you last learned the program.
- dredmorbius 2y agoThat's how I discovered the '&' regex feature in less some years back.
- teddyh 2y agoDo you mean PCRE’s “(?&name)” feature? That is not portable; for instance, Python calls it “(?P=name)”. Or do you mean the common feature of “&” in the replacement string meaning “the whole matched string”? While this feature is common in languages which use regexps (including ed, sed, awk, etc.), that’s not actually a regexp feature, since the & character has that effect in the replacement string, not in the regular expression. It is also not always portable; for instance, Emacs requires escaping as \& for the character to have the special feature.
- dredmorbius 2y agoFrom man(1) less: &pattern Display only lines which match the pattern; lines which do not match the pattern are not displayed. If pattern is empty (if you type & immediately followed by ENTER), any filtering is turned off, and all lines are displayed. While filtering is in effect, an ampersand is displayed at the beginning of the prompt, as a reminder that some lines in the file may be hidden. $ less --version less 487 (GNU regular expressions) Copyright (C) 1984-2016 Mark Nudelman
- teddyh 2y agoOh, you meant the program “less”! Right, I understand what you meant now.
- dredmorbius 2y ago:-) Yeah. I was viewing some files and thinking "it'd be really cool if less(1) had some way of filtering to just lines matching a specific pattern". RTFM'd and TIL'd. Mind that at that point I'd used less for ... oh, at least 30 years.
- sgarland 2y agoAgreed. This is also how I found out that features in Python I took for granted, like breakpoint(), were much more recent than I thought (3.7). Nothing like having to use ancient versions of a language to discover limitations.
- akvadrako 2y agoI do a fair bit of bash scripting and there is no way I can remember all the features and syntax I use, so of course I read parts of the manual regularly and often learn new things. You don't need to ever read the whole thing.
- sgarland 2y agoI once worked with a dev (frontend, of all things) who reread the bash manual annually. I work in ops, and I don’t even have that dedication. My hat is off to them.