Linux运维_Bash脚本_部署安装DocBook-XSL-1.79.1(XSL-Stylesheets)

2024-03-01 17:28

本文主要是介绍Linux运维_Bash脚本_部署安装DocBook-XSL-1.79.1(XSL-Stylesheets),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

Linux运维_Bash脚本_部署安装DocBook-XSL-1.79.1(XSL-Stylesheets)

Bash (Bourne Again Shell) 是一个解释器,负责处理 Unix 系统命令行上的命令。它是由 Brian Fox 编写的免费软件,并于 1989 年发布的免费软件,作为 Sh (Bourne Shell) 的替代品。

您可以在 Linux 和 MacOS 机器上使用 Bash,甚至可以通过适用于 Linux 的 Windows 子系统在 Windows 10 机器上使用。

使用方法

  • 下载源码包:

docbook-xsl-1.79.1.tar.bz2

docbook-xsl-doc-1.79.1.tar.bz2

  • 放于指定路径:

这里 Bash Shell 脚本的全局变量 STORAGE 指定的存放源码包的路径 /home/goufeng 可进行修改。

  • 执行 Bash Shell 脚本:

输入 /[路径名]/[脚本名].sh 即可进行自动编译部署,过程中提示输入 (y/n) 输入 y 则进行下一步,这样分阶段确认的原因是为了确保能够看到上一个源码编译结果中可能的错误和提示。

完整脚本

#! /bin/bash
# Create By GF 2024-03-01 12:19# Need File: docbook-xsl-1.79.1.tar.bz2
# Need File: docbook-xsl-doc-1.79.1.tar.bz2# ##################################################
STORAGE=/home/goufeng# Function: 部署安装(Deploy Install) XSL-Stylesheets: DocBook-XSL-1.79.1
# ##################################################
function Deploy_Install_XSL_Stylesheets_DocBook_XSL_1_79_1() {# Linux 的 install 命令用于安装或升级软件、备份数据。## 其常用的格式有: # #     1. install [OPTION]... SOURCE DEST: 将源文件复制到目标目录。#     #     2. install [OPTION]... SOURCE... DIRECTORY: 将多个源文件复制到已存在的目录。#     #     3. install -d [OPTION]... DIRECTORY...: 在指定目录下创建新目录。# # 常用的参数包括: # #     1. -c: 如果目标文件已经存在, 不覆盖, 保留原有的文件。#     #     2. -D: 如果目标文件是一个目录, 则在该目录下创建源文件的一个快捷方式。#     #     3. -b: 如果目标文件已经存在, 则将目标文件备份, 并将源文件复制到目标文件路径。#     #     4. -m: 设置目标文件的权限。#     #     5. -o: 设置目标文件的拥有者。#     #     6. -p: 以源文件 访问/修改 的时间作为目标文件的时间属性, 即不改变文件的时间属性。#     #     7. -s: 对待拷贝的可执行文件进行 strip 操作, 取出文件中的符号表。if [[ ! -d "/usr/share/xml/docbook/xsl-stylesheets-1.79.1" ]]; then# 安装目录: /usr/share/xml/docbook/xsl-stylesheets-1.79.1 和 /usr/share/doc/docbook-xsl-1.79.1# Installed Directories: /usr/share/xml/docbook/xsl-stylesheets-1.79.1 and /usr/share/doc/docbook-xsl-1.79.1local VERIFYlocal STEP_UNZIPPED=0local STEP_INSTALLED=0local STEP_CONFIGURED=0# ------------------------------------------read -p "[Confirm] Deploy and Install ( XSL-Stylesheets: DocBook-XSL-1.79.1 )? (y/n)>" VERIFYif [[ "$VERIFY" != "y" ]]; then exit 1; fi# ------------------------------------------tar -jxvf $STORAGE/docbook-xsl-1.79.1.tar.bz2 && \tar -jxvf $STORAGE/docbook-xsl-doc-1.79.1.tar.bz2 && STEP_UNZIPPED=1# ------------------------------------------cd $STORAGE/docbook-xsl-1.79.1# ------------------------------------------# 安装 DocBook XSL 样式表# Installation of DocBook XSL Stylesheets## 以根用户身份运行以下命令, 安装 DocBook XSL 样式表: # Install DocBook XSL Stylesheets by running the following commands as the root user:install -v -m755 -d /usr/share/xml/docbook/xsl-stylesheets-1.79.1 &&cp -v -R VERSION assembly common eclipse epub epub3 extensions fo        \highlighting html htmlhelp images javahelp lib manpages params  \profiling roundtrip slides template tests tools webhelp website \xhtml xhtml-1_1 xhtml5                                          \/usr/share/xml/docbook/xsl-stylesheets-1.79.1 &&ln -s VERSION /usr/share/xml/docbook/xsl-stylesheets-1.79.1/VERSION.xsl &&install -v -m644 -D README \/usr/share/doc/docbook-xsl-1.79.1/README.txt &&install -v -m644    RELEASE-NOTES* NEWS* \/usr/share/doc/docbook-xsl-1.79.1# ------------------------------------------cd $STORAGE/docbook-xsl-doc-1.79.1# ------------------------------------------# 如果下载了可选的源码文档 tarball, 请以 root 用户身份发出以下命令来安装源码文档: # If you downloaded the optional documentation tarball, install the documentation by issuing the following command as the root user:cp -v -R doc/* /usr/share/doc/docbook-xsl-1.79.1# ------------------------------------------# 配置 DocBook XSL 样式表# Configuring DocBook XSL Stylesheets## Config Files: /etc/xml/catalog## /etc/xml/catlog 文件示例:# /etc/XML/catlog Example of File:## <?xml version="1.0"?># <!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd"># <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">#   <rewriteSystem systemIdStartString="http://docbook.sourceforge.net/release/xsl/1.79.1" rewritePrefix="/usr/share/xml/docbook/xsl-stylesheets-1.79.1"/>#   <rewriteURI uriStartString="http://docbook.sourceforge.net/release/xsl/1.79.1" rewritePrefix="/usr/share/xml/docbook/xsl-stylesheets-1.79.1"/>#   <rewriteSystem systemIdStartString="http://docbook.sourceforge.net/release/xsl/current" rewritePrefix="/usr/share/xml/docbook/xsl-stylesheets-1.79.1"/>#   <rewriteURI uriStartString="http://docbook.sourceforge.net/release/xsl/current" rewritePrefix="/usr/share/xml/docbook/xsl-stylesheets-1.79.1"/># </catalog>## 作为 root 用户, 使用以下命令创建 (或附加) 并填充 XML catalog 文件:# Create (or append) and populate the XML catalog file using the following commands as the root user:if [ ! -d /etc/xml ]; then install -v -m755 -d /etc/xml; fi &&if [ ! -f /etc/xml/catalog ]; thenxmlcatalog --noout --create /etc/xml/catalogfi &&xmlcatalog --noout --add "rewriteSystem" \"http://docbook.sourceforge.net/release/xsl/1.79.1" \"/usr/share/xml/docbook/xsl-stylesheets-1.79.1" \/etc/xml/catalog &&xmlcatalog --noout --add "rewriteURI" \"http://docbook.sourceforge.net/release/xsl/1.79.1" \"/usr/share/xml/docbook/xsl-stylesheets-1.79.1" \/etc/xml/catalog &&xmlcatalog --noout --add "rewriteSystem" \"http://docbook.sourceforge.net/release/xsl/current" \"/usr/share/xml/docbook/xsl-stylesheets-1.79.1" \/etc/xml/catalog &&xmlcatalog --noout --add "rewriteURI" \"http://docbook.sourceforge.net/release/xsl/current" \"/usr/share/xml/docbook/xsl-stylesheets-1.79.1" \/etc/xml/catalog# ------------------------------------------# 有时, 您可能会发现需要安装其他版本的 XSL 样式表, 因为某些项目引用了特定的版本。# 一个例子是 BLFS-6.0, 它需要 1.67.2 版本。# 在这些情况下, 您应该在其自己的版本目录中安装任何其他所需版本, 并按如下方式创建目录条目 (用所需的版本号代替 <version>): # Occasionally, you may find the need to install other versions of the XSL stylesheets as some projects reference a specific version. # One example is BLFS-6.0, which required the 1.67.2 version. # In these instances you should install any other required version in its own versioned directory and create catalog entries as follows (substitute the desired version number for <version>):## xmlcatalog --noout --add "rewriteSystem" \#            "http://docbook.sourceforge.net/release/xsl/<version>" \#            "/usr/share/xml/docbook/xsl-stylesheets-<version>" \#     /etc/xml/catalog &&# # xmlcatalog --noout --add "rewriteURI" \#            "http://docbook.sourceforge.net/release/xsl/<version>" \#            "/usr/share/xml/docbook/xsl-stylesheets-<version>" \#     /etc/xml/catalog# ------------------------------------------cd $STORAGE && rm -rf $STORAGE/docbook-xsl-1.79.1 && \cd $STORAGE && rm -rf $STORAGE/docbook-xsl-doc-1.79.1 && return 0elseecho "[Caution] Path: ( /usr/share/xml/docbook/xsl-stylesheets-1.79.1 ) Already Exists."# ------------------------------------------return 0fi
}function main() {Deploy_Install_XSL_Stylesheets_DocBook_XSL_1_79_1
}main

总结

以上就是关于 Linux运维 Bash脚本 部署安装DocBook-XSL-1.79.1(XSL-Stylesheets) 的全部内容。

更多内容可以访问我的代码仓库:

https://gitee.com/goufeng928/public

https://github.com/goufeng928/public

这篇关于Linux运维_Bash脚本_部署安装DocBook-XSL-1.79.1(XSL-Stylesheets)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/763234

相关文章

linux hostname设置全过程

《linuxhostname设置全过程》:本文主要介绍linuxhostname设置全过程,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录查询hostname设置步骤其它相关点hostid/etc/hostsEDChina编程A工具license破解注意事项总结以RHE

Linux中压缩、网络传输与系统监控工具的使用完整指南

《Linux中压缩、网络传输与系统监控工具的使用完整指南》在Linux系统管理中,压缩与传输工具是数据备份和远程协作的桥梁,而系统监控工具则是保障服务器稳定运行的眼睛,下面小编就来和大家详细介绍一下它... 目录引言一、压缩与解压:数据存储与传输的优化核心1. zip/unzip:通用压缩格式的便捷操作2.

Python中win32包的安装及常见用途介绍

《Python中win32包的安装及常见用途介绍》在Windows环境下,PythonWin32模块通常随Python安装包一起安装,:本文主要介绍Python中win32包的安装及常见用途的相关... 目录前言主要组件安装方法常见用途1. 操作Windows注册表2. 操作Windows服务3. 窗口操作

Linux中SSH服务配置的全面指南

《Linux中SSH服务配置的全面指南》作为网络安全工程师,SSH(SecureShell)服务的安全配置是我们日常工作中不可忽视的重要环节,本文将从基础配置到高级安全加固,全面解析SSH服务的各项参... 目录概述基础配置详解端口与监听设置主机密钥配置认证机制强化禁用密码认证禁止root直接登录实现双因素

在Linux终端中统计非二进制文件行数的实现方法

《在Linux终端中统计非二进制文件行数的实现方法》在Linux系统中,有时需要统计非二进制文件(如CSV、TXT文件)的行数,而不希望手动打开文件进行查看,例如,在处理大型日志文件、数据文件时,了解... 目录在linux终端中统计非二进制文件的行数技术背景实现步骤1. 使用wc命令2. 使用grep命令

Linux如何快速检查服务器的硬件配置和性能指标

《Linux如何快速检查服务器的硬件配置和性能指标》在运维和开发工作中,我们经常需要快速检查Linux服务器的硬件配置和性能指标,本文将以CentOS为例,介绍如何通过命令行快速获取这些关键信息,... 目录引言一、查询CPU核心数编程(几C?)1. 使用 nproc(最简单)2. 使用 lscpu(详细信

利用Python脚本实现批量将图片转换为WebP格式

《利用Python脚本实现批量将图片转换为WebP格式》Python语言的简洁语法和库支持使其成为图像处理的理想选择,本文将介绍如何利用Python实现批量将图片转换为WebP格式的脚本,WebP作为... 目录简介1. python在图像处理中的应用2. WebP格式的原理和优势2.1 WebP格式与传统

linux重启命令有哪些? 7个实用的Linux系统重启命令汇总

《linux重启命令有哪些?7个实用的Linux系统重启命令汇总》Linux系统提供了多种重启命令,常用的包括shutdown-r、reboot、init6等,不同命令适用于不同场景,本文将详细... 在管理和维护 linux 服务器时,完成系统更新、故障排查或日常维护后,重启系统往往是必不可少的步骤。本文

基于Linux的ffmpeg python的关键帧抽取

《基于Linux的ffmpegpython的关键帧抽取》本文主要介绍了基于Linux的ffmpegpython的关键帧抽取,实现以按帧或时间间隔抽取关键帧,文中通过示例代码介绍的非常详细,对大家的学... 目录1.FFmpeg的环境配置1) 创建一个虚拟环境envjavascript2) ffmpeg-py

gitlab安装及邮箱配置和常用使用方式

《gitlab安装及邮箱配置和常用使用方式》:本文主要介绍gitlab安装及邮箱配置和常用使用方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录1.安装GitLab2.配置GitLab邮件服务3.GitLab的账号注册邮箱验证及其分组4.gitlab分支和标签的