Timeline for grepping for word starting with hyphen gives error: invalid option -- 't'
Current License: CC BY-SA 3.0
13 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Apr 13, 2017 at 12:36 | history | edited | CommunityBot | replaced http://unix.stackexchange.com/ with https://unix.stackexchange.com/ | |
| Nov 22, 2016 at 6:13 | comment | added | Sundeep | @Wildcard, here's my current version of script .. as you've pointed out in this answer, it has its drawbacks but works well for many cases... will check out the groff rabbit hole and get back to you :) | |
| Nov 18, 2016 at 20:25 | vote | accept | karel | ||
| Nov 18, 2016 at 3:07 | comment | added | Wildcard | @Sundeep, here's the starting point for you. (Be sure to follow the link in that answer.) There's a LOT to know about troff. Ping me in chat when you finish diving down the rabbit hole. :) | |
| Nov 18, 2016 at 2:57 | comment | added | Sundeep | @Wildcard will check it out, thanks... irregular spacing between different man pages makes it lot tougher and require patches.. my script so far works for most of my use cases though, needed a script to work a bit like explainshell, for ex: ch ls -latr -h | |
| Nov 18, 2016 at 2:52 | comment | added | Wildcard | BTW, @Sundeep, you might want to try parsing the underlying troff files containing the original man page info with format information, instead of the text output of the man command. | |
| Nov 18, 2016 at 2:50 | comment | added | Wildcard | @Sundeep, true. I updated with the actual command used. I didn't think it crucial because my point is that's not a good way to get the data, but it's better this way; thanks. | |
| Nov 18, 2016 at 2:50 | history | edited | Wildcard | CC BY-SA 3.0 | added 13 characters in body |
| Nov 18, 2016 at 2:44 | comment | added | Sundeep | man find | sed -n '/-type/,/^$/p' gives lot more than what you posted as it will match -type anywhere in the line... am working on small script myself to search man or help (for builtin) and currently using awk which still has few quirks to solve.. awk -v RS= -v rx="^\\\s*$arg\\\>" '$0 ~ rx' "$file" where arg would be -type in this case | |
| Nov 18, 2016 at 0:06 | comment | added | Wildcard | @karel, no problem, I'm very patient. :) A little puzzled, though: I know you can't start a bounty on a question for two days, but I believe the time limit before you can accept an answer is only 15 minutes or so. | |
| Nov 18, 2016 at 0:02 | comment | added | karel | Thank you for posting. The commands in your answer returned the results that I was looking for. I will accept an answer after a day or two, so please be patient. | |
| Nov 17, 2016 at 23:51 | history | edited | Wildcard | CC BY-SA 3.0 | added 1178 characters in body |
| Nov 17, 2016 at 23:35 | history | answered | Wildcard | CC BY-SA 3.0 |