summaryrefslogtreecommitdiff
path: root/generate.sh
blob: 37e39e019ac9b311ab6599d7918128723d1989e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/bash
# Read and extract the 20 first lines of each manual listed in a file
# Clean them from empty and non interesting information
# This stuff is made to be use as fortune-mod

# This software is GPLv2 more information at gnu.org

# Author: Aurélien DESBRIÈRES
# aurelien@hackers.camp

#!/bin/bash

#compgen -c > LIST

#while read -r LINE; do
#    MANWIDHT=80 man "$LINE" | head -20 | grep -v -e -f LIST | grep -v '^$' && echo
#done < LIST > list | sed -i -e 's/^$/%/' list
#cat list > fortune-rtfm

compgen -c | while read -r LINE; do
    MANWIDHT=80 man "$LINE" | head -20 | grep -v -f words | grep -v '^$' && echo
done | sed -e 's/^$/%/' > fortune-rtfm
sed -i 's/^ *//' fortune-rtfm