|
|
Could such a script scrub duplicate chars in a text file?
You can do what you're asking for within 'man' itself, using syntax similar to that of the vi editor. Here's the help screen you get
Most commands optionally preceded by integer argument k. Defaults in brackets. Star (*) indicates argument becomes new default. ------------------------------------------------------------------------------- <space> Display next k lines of text [current screen size] z Display next k lines of text [current screen size]* <return> Display next k lines of text [1]* d or ctrl-D Scroll k lines [current scroll size, initially 11]* q or Q or <interrupt> Exit from more s Skip forward k lines of text [1] f Skip forward k screenfuls of text [1] b or ctrl-B Skip backwards k screenfuls of text [1] ' Go to place where previous search started = Display current line number /<regular expression> Search for kth occurrence of regular expression [1] n Search for kth occurrence of last r.e [1] !<cmd> or :!<cmd> Execute <cmd> in a subshell v Starts $EDITOR or /usr/bin/vi at current line ctrl-L Redraw screen :n Go to kth next file [1] :p Go to kth previous file [1] :f Display current file name and line number . Repeat previous command ------------------------------------------------------------------------------- This could all be inherited from the current $EDITOR environment variable, and seeing as I haven't currently set $EDITOR it might be defaulting to the 'more' pager command. In other words, if you want to page through files with a different pager then set $EDITOR and the man command will use it instead. *testing...* No, the variable to set seems to be $PAGER, not in this case $EDITOR. So, if you want to use the less command (which has a much richer syntax) and you're using the default tcsh as your shell, then run "setenv PAGER less" to add the variable to your current enviromnent [or put this in a login script so that it works all the time] and then run man again. It should now support more interesting syntax than that offered by, well, 'more'. Sure enough, I test this now as I'm writing, setting less as my $PAGER and then viewing a long manpage, and when I hit 'h' to bring up help I get a different display than what you see above -- much more than can be reasonably pasted into this form. See for yourself if you'd like to try it :-) |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.07 seconds |
|