man:
#! /bin/shI actually like that because it's easier to grep the output, but adding a pipe to "less" more accurately approximates the real command. You could probably roll the grep into the sed command, but that's one of those things where I don't mind spending an extra one-thousandth of a second execution time to keep from having to craft a better sed one-liner.
links -dump http://unixhelp.ed.ac.uk/CGI/man-cgi?${1} | grep -A 1000 NAME | sed 's/^[ \t]*//'
whatis:
#! /bin/shLet's test it.
links -dump http://unixhelp.ed.ac.uk/CGI/man-cgi?${1} | grep "\- " | head -1 | sed 's/^[ \t]*//'
# whatis ifconfigClose enough.
ifconfig [] (8) - configure a network interface
# ./my_whatis ifconfig
ifconfig - configure a network interface
#