Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Add linux man page docset to Dash
#!/bin/bash
# Under instructions in: https://blog.kapeli.com/linux-man-pages-in-dash
set -x
set -e
man_path_dest_dir="/usr/local/share/man"
man_pages_version="5.06"
linux_man_pages_download_link="https://mirrors.edge.kernel.org/pub/linux/docs/man-pages/man-pages-${man_pages_version}.tar.xz"
wget -nv ${linux_man_pages_download_link} -O /tmp/man-pages-${man_pages_version}.tar.xz
if [ $? -ne 0 ]; then
echo "Download man pages ${man_pages_version} error"
exit 1
fi
tar xvf /tmp/man-pages-${man_pages_version}.tar.xz -C /tmp
if [ $? -ne 0 ]; then
echo "Extract man pages ${man_pages_version} error"
exit 1
fi
cd /tmp/man-pages-${man_pages_version}
for i in {1..7}; do
cd man$i
if [ ! -d ${man_path_dest_dir}/man$i ]; then
mkdir ${man_path_dest_dir}/man$i
fi
for item in *
do
mv $item ${man_path_dest_dir}/man$i/linux_$item
done
cd ../
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.