Unable to make Less to indicate location in percentage -
Now when you run I have to show the percent sign, for example,
Informs me that we need to create a separate shell function
man "$ 1". | Col -b & gt; / Tmp / manual low / TMP / manual
where $ 1 refers to the first parameter.
The new problem is on this Thanks for Yuliy for crooks tricks!
solution
At least manual versions work quite well By way of:
<
Export MANPAGER = 'less -sM + Gg'
to one of the shell configuration files (for synthesis of Bash and ZSH). For example, for example, man man
shows the percentage you want!
Warning
You not lower
in + gg
variable! For example, when reading large files
export less = '- m + gg'
can cause problems, for example
yes | Less = '- m + gg' less
does not work very well ...
explanation
as explained in the other answer The problem is that less
can not say that you are in the percentage file until it does not know how long the file is, and it reads while reading from a pipe to the end of the file Do not go options
to less of a man
:
If a command line option starts with + To reduce the preliminary command, for the exam, + G tells the less to start at the end of the file instead of the beginning, and +/exi it starts in the file before the "XIZ" Tells for As a special case, + & lt; Number & gt; + & Lt; Number & gt; Works like g; That is, it starts displaying in a specific line number (though, see the warning under the "G" com above). If the option starts with ++, then the initial comm-mand applies to each file, not only for the first time. + The previously described command can also be used (or can change) to set initial commands for each file.
g
means "return to the beginning of the file".
-P pager, --pager = pager Specify which output pager to use. By default, man uses Pager-S. This option overrides the $ MANPAGER environment variable, which in turn overrides the $ PAGER environment variable. It is not used in conjunction with -f or -k, the value can be a command with a simple command name or argument, and can use shell quotes (backslash, single quotes, or double quotes). It can not use pipes to connect to many orders; If you need this, then use a wrapper script, which can take the file as an argument or to display on standard input
Comments
Post a Comment