TIME NOW
World current time now,
CALENDAR
Calendar monthly, yearly
login CONVERT LENGTH
login CONVERT TEMPERATURE
login DICTIONARIES, LISTS
login SCIENCE EDUCATION RELIGION
login WORK CALCULATOR
login CALCULATE LIFE

Linux commands, scripts, examples, tutorial

Previous articlePage bottomNext article  ALL TOPICS

Linux. man2html example. Make web pages from man pages

 Debian install all man pages:
apt-get --fix-missing install manpages funny-manpages freebsd-manpages manpages-posix manpages-ru manpages-pl
Make HTML pages:
#!/bin/sh

folder1=/usr/share/man
folder2=/_scripts/_commands/helps

echo test

for i in 1 2 3 4 5 6 7 8
    do
    
    folder3=$folder2/man$i
    mkdir $folder3
    
    echo $folder1/man$i
    files=` ls $folder1/man$i `
    echo  $files
    
    for file in $files
          do
            
                    echo $i $file

                    case $i in
                    1)
                    
                    fileFin=` echo $file | awk -F .1.gz ' { print $1 ".1." } ' `
                    ;;
                    2)
                
                    fileFin=` echo $file | awk -F .2.gz ' { print $1 ".2." } ' `
                    ;;
                    3)
                
                    fileFin=` echo $file | awk -F .3.gz ' { print $1 ".3." } ' `    
                    ;;
                    4)
                
                    fileFin=` echo $file | awk -F .4.gz ' { print $1 ".4." } ' `    
                    ;;
                    5)
                
                    fileFin=` echo $file | awk -F .5.gz ' { print $1 ".5." } ' `    
                    ;;
                    6)
                    
                    fileFin=` echo $file | awk -F .6.gz ' { print $1 ".6." } ' `    
                    ;;
                    7)
                    
                    fileFin=` echo $file | awk -F .7.gz ' { print $1 ".7." } ' `    
                    ;;
                    8)
                        
                    fileFin=` echo $file | awk -F .8.gz ' { print $1 ".8." } ' `
                    ;;
                    #*)
                    
                    #echo "default"
            
                    esac
            
            man2html -r $folder1/man$i/$file > $folder3/${fileFin}html
            
    done
    
done

exit 0   
   
 
Previous articlePage topNext article  ALL TOPICS



 Use username: Guest, Anonymous, Programmer






QUOTES:
It is better to live richly than to die rich.
Author Unknown
It is every man's obligation to put back into the world at least the equivalent of what he takes out of it.
Albert Einstein
One must love a cat on its own terms.
Peter Gray