Skip to Content.
Sympa Menu

baslinux - [BL] Fixed My Man Script

baslinux AT lists.ibiblio.org

Subject: Baslinux mailing list

List archive

Chronological Thread  
  • From: Lee Forrest <lforrestster AT gmail.com>
  • To: baslinux AT lists.ibiblio.org
  • Subject: [BL] Fixed My Man Script
  • Date: Sat, 30 Dec 2006 19:35:52 +0000

It was overwriting the symlinks to the real manpage with
the real manpage.

Here's the new version:

#!/bin/sh

#for plain text man pages in /usr/man

# put your favorite editor here

ed=/usr/bin/nvi

# first arg to man on the commandline
file=$1

# see if ${1}.gz is a symlink.

if test -h ${file}.gz

#if it is, extract the name of the manpage, minus ".gz"
# and assign it to $file

then file=`ls -l ${file}.gz | sed -n 's/^\(.* \)\(.*\)\(.gz$\)/\2/p'`
fi

gunzip /usr/man/${file}.gz &&
$ed /usr/man/${file} &&
gzip /usr/man/${file}

----------------

Lee

--
BasicLinux: Small is Beautiful
http://www.basiclinux.com.ru





Archive powered by MHonArc 2.6.24.

Top of Page