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

相关文章

python安装whl包并解决依赖关系的实现

《python安装whl包并解决依赖关系的实现》本文主要介绍了python安装whl包并解决依赖关系的实现,文中通过图文示例介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面... 目录一、什么是whl文件?二、我们为什么需要使用whl文件来安装python库?三、我们应该去哪儿下

MySQL安装时initializing database失败的问题解决

《MySQL安装时initializingdatabase失败的问题解决》本文主要介绍了MySQL安装时initializingdatabase失败的问题解决,文中通过图文介绍的非常详细,对大家的学... 目录问题页面:解决方法:问题页面:解决方法:1.勾选红框中的选项:2.将下图红框中全部改为英

Python脚本实现图片文件批量命名

《Python脚本实现图片文件批量命名》这篇文章主要为大家详细介绍了一个用python第三方库pillow写的批量处理图片命名的脚本,文中的示例代码讲解详细,感兴趣的小伙伴可以了解下... 目录前言源码批量处理图片尺寸脚本源码GUI界面源码打包成.exe可执行文件前言本文介绍一个用python第三方库pi

MySQL9.0默认路径安装下重置root密码

《MySQL9.0默认路径安装下重置root密码》本文主要介绍了MySQL9.0默认路径安装下重置root密码,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们... 目录问题描述环境描述解决方法正常模式下修改密码报错原因问题描述mysqlChina编程采用默认安装路径,

Linux使用cut进行文本提取的操作方法

《Linux使用cut进行文本提取的操作方法》Linux中的cut命令是一个命令行实用程序,用于从文件或标准输入中提取文本行的部分,本文给大家介绍了Linux使用cut进行文本提取的操作方法,文中有详... 目录简介基础语法常用选项范围选择示例用法-f:字段选择-d:分隔符-c:字符选择-b:字节选择--c

SpringBoot中整合RabbitMQ(测试+部署上线最新完整)的过程

《SpringBoot中整合RabbitMQ(测试+部署上线最新完整)的过程》本文详细介绍了如何在虚拟机和宝塔面板中安装RabbitMQ,并使用Java代码实现消息的发送和接收,通过异步通讯,可以优化... 目录一、RabbitMQ安装二、启动RabbitMQ三、javascript编写Java代码1、引入

shell脚本自动删除30天以前的文件(最新推荐)

《shell脚本自动删除30天以前的文件(最新推荐)》该文章介绍了如何使用Shell脚本自动删除指定目录下30天以前的文件,并通过crontab设置定时任务,此外,还提供了如何使用Shell脚本删除E... 目录shell脚本自动删除30天以前的文件linux按照日期定时删除elasticsearch索引s

Python使用国内镜像加速pip安装的方法讲解

《Python使用国内镜像加速pip安装的方法讲解》在Python开发中,pip是一个非常重要的工具,用于安装和管理Python的第三方库,然而,在国内使用pip安装依赖时,往往会因为网络问题而导致速... 目录一、pip 工具简介1. 什么是 pip?2. 什么是 -i 参数?二、国内镜像源的选择三、如何

Linux使用nload监控网络流量的方法

《Linux使用nload监控网络流量的方法》Linux中的nload命令是一个用于实时监控网络流量的工具,它提供了传入和传出流量的可视化表示,帮助用户一目了然地了解网络活动,本文给大家介绍了Linu... 目录简介安装示例用法基础用法指定网络接口限制显示特定流量类型指定刷新率设置流量速率的显示单位监控多个

ElasticSearch+Kibana通过Docker部署到Linux服务器中操作方法

《ElasticSearch+Kibana通过Docker部署到Linux服务器中操作方法》本文介绍了Elasticsearch的基本概念,包括文档和字段、索引和映射,还详细描述了如何通过Docker... 目录1、ElasticSearch概念2、ElasticSearch、Kibana和IK分词器部署