5

http://manpages.ubuntu.com is a great resource for viewing manpages not installed in the system. However, it uses some weird programming to redirect short URLs like http://manpages.ubuntu.com/ls.1 to http://manpages.ubuntu.com/manpages/wily/en/man1/ls.1posix.html, and it always picks the latest release. Otherwise, it works fine when using lynx with the full URL. It even looks like a normal manpage:

enter image description here

The redirection doesn't work in lynx (or elinks or w3m). Just to check, I tried on my Arch Linux elinks, which apparently does support JavaScript:

$ elinks -version
ELinks 0.13.GIT a3751107033599b835eaafa61177c8d4dda4b7ef-dirty
Built on Oct 31 2013 20:43:18

Features:
Standard, IPv6, gzip, bzip2, UTF-8, Periodic Saving, Viewer (Search
History, Timer, Marks), Cascading Style Sheets, Protocol
(Authentication, File, CGI, FTP, HTTP, URI rewrite, User protocols),
SSL (OpenSSL), MIME (Option system, Mailcap, Mimetypes files), LED
indicators, Bookmarks, Cookies, ECMAScript (SpiderMonkey), Form
History, Global History, Scripting (Lua, Spidermonkey ECMAScript), Goto
URL History

edbrowse didn't redirect either. That's that for the suggestions from Is there a text mode browser which supports javascript?

Using the full URL would be workable if I knew the section, which is not always the case. Is there a program which can bring up the online manpage, preferably for the running Ubuntu version? In case of matches in multiple sections, it should behave like man does.

muru
  • 197,895
  • 55
  • 485
  • 740
  • 1
    Try dman in the bikeshed package: for ls it doesn't do that redirection, didn't test for the behavior in case of multiple matches though. – kos Dec 28 '15 at 08:32
  • @kos Yep, for matches in multiple sections, it opens each section's manpages (but doesn't distinguish between 1 and 1posix, for example). Hmm, thanks for the suggestion. I'll look into improving it. – muru Dec 28 '15 at 10:15

1 Answers1

-1

You can just give lynx the search url with the man page you want. In the search results use the lynx l command to list the returned links and choose the one you want. Eg for ls.1:

lynx 'http://manpages.ubuntu.com/cgi-bin/search.py?lr=lang_en&q=ls.1'
meuh
  • 3,211
  • -1 that still leaves me the problem of selecting one of the manpages myself. If I wanted to do this, I could just use the search box in manpages.ubuntu.com directly in lynx, without bothering with a ridiculous url – muru Dec 28 '15 at 09:46
  • You can take the dman command mentioned by kos, which can take a --release trusty option, and uses wget on all the possible sections, doing a man on any that work. Simply replace the man by lynx on the equivalent url. – meuh Dec 28 '15 at 09:57
  • I can do a lot of things, but if I wanted to do things manually, I could already search in lynx without doing anything you have suggested so far. – muru Dec 28 '15 at 09:58