English 中文(简体)
Remove page numbers from man pages in Solaris?
原标题:

When I use Solaris, I get page numbers every 60 lines or so that look like this

SunOS 5.11          Last change: 10 Feb 2009                    1

Also, I get headers like

User Commands                         ls(1)

Is there any way to remove them? It s distracting to have them appear when I m reading text line by line.

最佳回答

I ended up removing them by editing the standard macro package (nroff) at /usr/share/lib/tmac/an to not show headers and footers.

问题回答

man pages are generally troff-formatted documents, so short of editing the various pages to remove the actual text I don t think there s any way to not see them.

try this

man grep | nawk  NR>2 | more

This is what I wrote to strip off these headers:

  /usr/bin/man $@ | nawk  
  BEGIN { i=0 }
  /SunOS 5.* *Last change:/ {
  for(j=0;j<i-3;j++) printf("%s
",line[j]);
  for(j=0;j<10;j++) getline;
  i=0; continue;
  }
  { line[i]=$0; i++; }
    | ${PAGER:-more}




相关问题
Portable way to get file size (in bytes) in the shell

On Linux, I use stat --format="%s" FILE, but the Solaris machine I have access to doesn t have the stat command. What should I use then? I m writing Bash scripts and can t really install any ...

Unix: fast remove directory for cleaning up daily builds

Is there a faster way to remove a directory then simply submitting rm -r -f *directory* ? I am asking this because our daily cross-platform builds are really huge (e.g. 4GB per build). So the ...

Startup time in Solaris server using shell script

How to find the start up time of a Solaris 5.1 server using a shell script,need to know how much time it took to be on running state?I need to know how much time it took to come to running mode from ...

Ruby 1.8.6 BigDecimal.to_f always returns 0,0 on Solaris

I have come across a very weird error. I m on Solaris 10, using Ruby Enterprise Edition (ruby 1.8.6 (2008-08-08 patchlevel 286) [i386-solaris2.10]) with Rails 2.3.4. I have a very weird error. In irb: ...

Where to set JDK to be used for SunOne server?

Where to set the JDK to be used by the SunOne server on Solaris? Is it all configured via an environment variable like JDK_HOME or JAVA_HOME, or is there a config file for the SunOne server somewhere ...

热门标签