当前位置: 首页 > news >正文

GNU/Linux - 宏处理工具M4

GNU M4
M4 = "Macro Processor, Version 4".
1, Introduction to GNU M4
GNU M4 是传统 Unix 宏处理器的实现。它主要与 SVR4 兼容,但也有一些扩展功能(例如,处理超过 9 个位置参数的宏命令)。GNU M4 还内置了包含文件、运行 shell 命令、运算等功能。
GNU M4 is an implementation of the traditional Unix macro processor. It is mostly SVR4 compatible although it has some extensions (for example, handling more than 9 positional parameters to macros). GNU M4 also has built-in functions for including files, running shell commands, doing arithmetic, etc.
GNU M4 是一个宏处理器,它可以将输入复制到输出,并不断扩展宏。宏可以是内置的,也可以是用户自定义的,并且可以接受任意数量的参数。除了进行宏扩展外,m4 还具有内置函数,可用于包含已命名文件、运行 UNIX 命令、进行整数运算、以各种方式处理文本、递归等......m4 既可用作编译器的前端,也可单独用作宏处理器。
GNU M4 is a macro processor in the sense that it copies its input to the output expanding macros as it goes. Macros are either builtin or user-defined and can take any number of arguments. Besides just doing macro expansion, m4 has builtin functions for including named files, running UNIX commands, doing integer arithmetic, manipulating text in various ways, recursion etc... m4 can be used either as a front-end to a compiler or as a macro processor in its own right.
GNU M4 的最大用户之一是 GNU Autoconf 项目。
One of the biggest users of GNU M4 is the GNU Autoconf project.
2, Downloading M4
最新的稳定版本是 1.4.19,可在 Index of /gnu/m4 [通过 http] 和 ftp://ftp.gnu.org/gnu/m4/ [通过 FTP]上找到。也可以在我们的 FTP 镜像 ( GNU Mirror List- GNU Project - Free Software Foundation) 中找到。稳定版开发分支也可以通过以下任一方式从 git 签出:
The latest stable version is 1.4.19, and can be found on Index of /gnu/m4  [via http] and ftp://ftp.gnu.org/gnu/m4/  [via FTP]. It can also be found on one of our FTP mirrors ( GNU Mirror List- GNU Project - Free Software Foundation). The stable development branch can also be checked out from git, using either of:
git clone git://git.sv.gnu.org/m4
git clone http://git.savannah.gnu.org/r/m4.git
followed by:
git checkout -b branch-1.4 origin/branch-1.4
3, Documentation
GNU M4 文档有多种格式,请访问 GNU M4 - GNU macro processor - GNU Project - Free Software Foundation。您也可以通过查看本地文档找到更多有关 GNU M4 的信息。例如,您可以尝试查看 /usr/share/doc/m4/,或在 shell 提示下使用 info m4。
GNU M4 documentation can be found in several formats at GNU M4 - GNU macro processor - GNU Project - Free Software Foundation. You may also find more information about GNU M4 by looking at your local documentation. For example, you might try looking in /usr/share/doc/m4/, or use info m4 at the shell prompt.
GNU M4 - GNU macro processor - GNU Project - Free Software Foundation
GNU M4 1.4.19 macro processor
4, Mailing Lists
GNU M4 有多个邮件列表: < bug-m4@gnu.org>、< m4-discuss@gnu.org>、< m4-patches@gnu.org> 和 < m4-announce@gnu.org>。这些邮件列表都有存档;请参阅每个邮件列表的详细信息以获取存档链接。
GNU M4 has several mailing lists: < bug-m4@gnu.org >, < m4-discuss@gnu.org >, < m4-patches@gnu.org >, and < m4-announce@gnu.org >. Archives of these lists are available; see the details of each list for a link to the archives.
您可以如下所述通过网络订阅任何 GNU 邮件列表。或者,您也可以向相关请求列表发送一封空邮件,在邮件标题行注明 “订阅”。例如,要订阅 bug-m4 列表,您可以向 < bug-m4-request@gnu.org> 发送一封没有正文、标题行仅为 “订阅 ”的邮件。
You can subscribe to any GNU mailing list via the web as described below. Or you can send an empty mail with a Subject: header line of just "subscribe" to the relevant request list. For example, to subscribe yourself to the bug-m4 list, you would send mail to < bug-m4-request@gnu.org > with no body and a Subject: header line of just "subscribe".
为防止垃圾邮件泛滥,有必要对 GNU M4 邮件列表进行管理。向邮件列表发布的内容由列表版主负责发布。有时,版主会在短时间内无法工作。请耐心等待。如果您在列表存档中没有看到该邮件,则说明该邮件没有被发布。
It has been necessary to moderate the GNU M4 mailing lists to prevent the flood of spam. Postings to the lists are held for release by the list moderator. Sometimes the moderators are unavailable for brief periods of time. Please be patient when posting. If you don't see the message in the list archive then it did not get posted.
5, Announcements
低容量邮件列表 m4-announce 包含有关 GNU M4 的所有公告。有关 M4 和大多数其他 GNU 软件的重要公告也在 < info-gnu@gnu.org> 上发布。
The low-volume mailing list m4-announce contains all announcements about GNU M4. Important announcements about M4 and most other GNU Software are also made on < info-gnu@gnu.org >.
6, Tracking Development
中型邮件列表 bug-m4 跟踪所有错误报告。有关提交错误报告的更多信息,请参阅下面的 “报告错误 ”部分。
The moderate-volume mailing list bug-m4 tracks all bug reports. For more information on submitting bugs, please see the section Report a Bug below.
中型邮件列表 m4-patches 用于提出和跟踪所有重要补丁。GNU M4 正在积极开发中,2.0 版本将有许多新功能,如更好的输入控制、多精度运算和可加载模块。有关 GNU M4 未来发展的更多信息,请访问 GNU M4 - Summary [Savannah]。您可以使用 git 跟踪开发进程:
The moderate-volume mailing list m4-patches is used to propose and track all significant patches. GNU M4 is being actively developed, and version 2.0 will have many new features, such as better input control, multiple precision arithmetic and loadable modules. More information about the future of GNU M4 is at GNU M4 - Summary [Savannah]. You can track development in git, using:
git clone git://git.sv.gnu.org/m4
git clone http://git.savannah.gnu.org/r/m4.git
You can also view the git tree on the web. ( http://git.sv.gnu.org/gitweb/?p=m4.git)
另外,这里还有一个只读的 CVS 镜像:
Alternatively, there is a read-only CVS mirror here:
cvs -d :pserver:anonymous@pserver.git.sv.gnu.org:/m4.git \
  co -d m4 HEAD

M4的使用和学习
Here’s a simple usage guide for GNU M4 with basic examples:
Step-by-Step: Example 1  Simple Usage of GNU M4
1. Install GNU M4
Make sure M4 is installed. You can check by typing:
m4 --version
If not installed, install it via your package manager (as described earlier).
2. Creating a Simple M4 Script
Let's create a basic file `example.m4` with simple macros.
define(`PI', `3.14159')
define(`greeting', `Hello, World!')
PI is the value of pi.
greeting
This file contains two macros:
- `PI` with the value `3.14159`
- `greeting` with the value `Hello, World!`
3. Running the M4 Script
To process the file using M4, open a terminal and run:
m4 example.m4
The output will be:
3.14159 is the value of pi.
Hello, World!
Example 2: Using Arguments in Macros
You can pass arguments to macros. In this example, let's define a macro that takes a name as an argument.
1. Create a file `greet.m4`:
define(`greet', `Hello, $1!')
greet(`Alice')
greet(`Bob')
2. Run the M4 script:
m4 greet.m4
The output will be:
Hello, Alice!
Hello, Bob!
Example 3: Simple Conditional with `ifelse`
You can use simple conditionals with `ifelse`.
1. Create a file `condition.m4`:
ifelse(`yes', `yes', `The answer is yes.', `The answer is no.')
2. Run the M4 script:
m4 condition.m4
Output:
The answer is yes.
这些是如何使用 GNU M4 定义宏、使用参数和条件的简单示例。它是一个非常通用的文本处理工具!
These are simple examples of how to define macros, use arguments, and conditionals with GNU M4. It’s a very versatile tool for text processing!
参考:
GNU M4 - GNU Project - Free Software Foundation

相关文章:

GNU/Linux - 宏处理工具M4

GNU M4 M4 "Macro Processor, Version 4". 1, Introduction to GNU M4 GNU M4 是传统 Unix 宏处理器的实现。它主要与 SVR4 兼容&#xff0c;但也有一些扩展功能&#xff08;例如&#xff0c;处理超过 9 个位置参数的宏命令&#xff09;。GNU M4 还内置了包含文件、…...

Oracle权限安全管理

实验内容 本次实验先使用system用户连接 温馨提示&#xff1a;题目要求切换账户登录的时候自己记得切换&#xff0c;本文章只提供相应的SQL语句 在表空间BOOKTBS1&#xff08;实验4第1题已创建&#xff09;创建一张表BOOKS,其字段如下&#xff1a;&#xff1a; SQL> create…...

C++笔记之静态多态和动态多态

C++笔记之静态多态和动态多态 code review! 在C++中,多态(Polymorphism)是面向对象编程的一个核心概念,允许对象以多种形式存在。多态性主要分为静态多态(Static Polymorphism)和动态多态(Dynamic Polymorphism)。下面将详细解释这两种多态及其在C++中的实现方式、优缺…...

Axure RP电商系统商城PC+app+后台买家卖端高保真原型模板及元件库

AxureRP电商商城PCapp后台买家卖端高保真原型模板本套包含三份原型图素材 APP买家端原型简介&#xff1a; 包含了用户中心、会员成长、优惠券、积分、互动社区、运营推广、内容推荐、商品展示、订单流程、订单管理、售后及服务等完整的电商体系功能架构和业务流程。 本模板由…...

RTX3070的yolo训练模型迁移到NVIDIA JETSON XAVIER NX 上的踩坑经验,时机部署避雷点

NVIDIA JETSON XAVIER NX 的yolo环境部署 首先为了保证yolo的权重模型pt文件可以顺利迁移过去&#xff0c;要保证torch和cuda的版本一致 如何在NX上安装torch? 1.用 jtop工具 实时查看和控制板子状态 安装: sudo -H pip3 install jetson-stats使用: sudo jtop 在这里是为…...

带你学习如何编写一篇API详设文档以及给新人提点建议

文章目录 前言先认清一个问题详设文档如何写先看文档脉络详设文档分析需求背景方案概述API定义安全设计性能设计缓存与数据库 总结 前言 这篇文章带读者了解软件开发项目中一个需求的开发详设文档主要包括哪些内容&#xff0c;其中重点会给读者分析API设计的规范&#xff0c;相…...

【Python爬虫实战】正则:多字符匹配、开头与结尾定位、分组技术详解

&#x1f308;个人主页&#xff1a;https://blog.csdn.net/2401_86688088?typeblog &#x1f525; 系列专栏&#xff1a;https://blog.csdn.net/2401_86688088/category_12797772.html 目录 前言 一、匹配多个字符 &#xff08;一&#xff09;匹配任意多个字符 &#xff0…...

DOIP协议介绍-1

1.DOIP中的GID和EID是什么&#xff1f; 在DOIP&#xff08;Diagnostics over IP&#xff09;中&#xff0c;GID&#xff08;Group Identification&#xff09;和EID&#xff08;Entity Identification&#xff09;是两个重要的标识符&#xff0c;它们各自承担着不同的角色和功…...

探索Python中的多线程与多进程

在Python编程中&#xff0c;多线程和多进程是两个重要的概念&#xff0c;它们被用来提高程序的执行效率。本文将深入探讨这两个概念&#xff0c;并对比它们在Python中的实现方式。 一、多线程 多线程是一种并发执行的程序设计方法。在Python中&#xff0c;我们可以使用thread…...

paypal php 实现详细攻略

一、准备工作 登录 https://www.paypal.com/ 注册一个主账号&#xff08;选择个人账号、企业账后都可&#xff09; 申请完成后登录https://developer.paypal.com/ 在后台右侧菜地点击“Accounts”&#xff0c;可以看到系统自动给分配的两个沙箱环境的账号。类型为Personal是个人…...

深入理解Dubbo原理鱼实现,提升职场竞争力

小熊学Java全能学习面试指南&#xff1a;https://www.javaxiaobear.cn 1、RPC RPC(Remote Procedure Call)远程过程调用&#xff0c;它是一种通过网络从远程计算机程序上请求服务。 大白话理解就是&#xff1a;RPC让你用别人家的东西就像自己家的一样。 RPC两个作用&#xff1…...

自动化测试与敏捷开发的重要性

敏捷开发与自动化测试是现代软件开发中两个至关重要的实践&#xff0c;它们相互补充&#xff0c;共同促进了软件质量和开发效率的提升。 敏捷开发的重要性 敏捷开发是一种以人为核心、迭代、循序渐进的软件开发方法。它强调以下几个核心价值观和原则&#xff1a; 个体和交互…...

气膜:冰雪产业的创新解决方案—轻空间

随着冰雪运动的普及和发展&#xff0c;如何在不同季节和地区有效开展冰雪项目&#xff0c;成为了行业内的一个重要课题。气膜作为一种新兴的建筑形式&#xff0c;凭借其独特的优势&#xff0c;正在逐渐成为冰雪产业的创新解决方案。 优越的建筑特性 气膜建筑以其轻便、快速搭建…...

期货配资网/分仓多元化/配资系统服务商

提供期货配资服务的网络平台搭建服务。这些平台致力于为投资者提供高效、便捷的期货投资渠道&#xff0c;通过配资的方式放大投资者的资金杠杆&#xff0c;从而增加其盈利机会。期货配资网一般具有以下特点&#xff1a; 专业服务&#xff1a;提供期货交易、投资管理及信息咨询…...

「漏洞复现」百易云资产管理运营系统 ufile.api.php SQL注入漏洞

0x01 免责声明 请勿利用文章内的相关技术从事非法测试&#xff0c;由于传播、利用此文所提供的信息而造成的任何直接或者间接的后果及损失&#xff0c;均由使用者本人负责&#xff0c;作者不为此承担任何责任。工具来自网络&#xff0c;安全性自测&#xff0c;如有侵权请联系删…...

Vue 3 和 Vue Router 使用 createWebHistory 配置

在 Vue 3 项目中&#xff0c;如果使用 Vue Router 并希望启用 HTML5 History 模式&#xff0c;需要在创建路由器实例时传入 createWebHistory 作为历史模式的配置。此外&#xff0c;还需要确保在生产环境中设置正确的基本路径&#xff08;base&#xff09;&#xff0c;这样才能…...

Nginx:rewrite指令之flag标志

Nginx 的 rewrite 指令用于根据正则表达式来匹配请求的 URI&#xff0c;并将其重写为新的 URI。rewrite 指令可以包含一个可选的 flag&#xff08;标志&#xff09;&#xff0c;该标志用于控制重写操作后的行为。 rewrite regex replacement [flag] 一. 常用四种 flag redir…...

C#从零开始学习(如何构建应用)

开始使用 C# 开发使用的软件Visual Studio 2019 文章所有的代码都放在 https://github.com/hikinazimi/head-first-Csharp 创建一个控制台应用 打开Visual Studio 2019 创建项目 选择控制台应用程序 创建后点击运行,就可以在控制台打印Hello World 构建一个游戏(创建WPF项目…...

FCoE简介

数据中心融合网络的发展趋势 如图1所示&#xff0c;传统数据中心组网中&#xff0c;以太网LAN&#xff08;Local Area Network&#xff09;用于服务器与服务器、客户端与服务器之间通信&#xff0c;存储区域网络SAN&#xff08;Storage Area Network&#xff09;用于服务器与存…...

论文笔记:Template-Based Named Entity Recognition Using BART

论文来源&#xff1a;ACL 2021 Finding 论文链接&#xff1a;https://aclanthology.org/2021.findings-acl.161.pdf 论文代码&#xff1a;GitHub - Nealcly/templateNER: Source code for template-based NER 笔记仅供参考&#xff0c;撰写不易&#xff0c;请勿恶意转载抄袭…...

观成科技:隐蔽隧道工具Ligolo-ng加密流量分析

1.工具介绍 Ligolo-ng是一款由go编写的高效隧道工具&#xff0c;该工具基于TUN接口实现其功能&#xff0c;利用反向TCP/TLS连接建立一条隐蔽的通信信道&#xff0c;支持使用Let’s Encrypt自动生成证书。Ligolo-ng的通信隐蔽性体现在其支持多种连接方式&#xff0c;适应复杂网…...

Flask RESTful 示例

目录 1. 环境准备2. 安装依赖3. 修改main.py4. 运行应用5. API使用示例获取所有任务获取单个任务创建新任务更新任务删除任务 中文乱码问题&#xff1a; 下面创建一个简单的Flask RESTful API示例。首先&#xff0c;我们需要创建环境&#xff0c;安装必要的依赖&#xff0c;然后…...

MongoDB学习和应用(高效的非关系型数据库)

一丶 MongoDB简介 对于社交类软件的功能&#xff0c;我们需要对它的功能特点进行分析&#xff1a; 数据量会随着用户数增大而增大读多写少价值较低非好友看不到其动态信息地理位置的查询… 针对以上特点进行分析各大存储工具&#xff1a; mysql&#xff1a;关系型数据库&am…...

理解 MCP 工作流:使用 Ollama 和 LangChain 构建本地 MCP 客户端

&#x1f31f; 什么是 MCP&#xff1f; 模型控制协议 (MCP) 是一种创新的协议&#xff0c;旨在无缝连接 AI 模型与应用程序。 MCP 是一个开源协议&#xff0c;它标准化了我们的 LLM 应用程序连接所需工具和数据源并与之协作的方式。 可以把它想象成你的 AI 模型 和想要使用它…...

Golang dig框架与GraphQL的完美结合

将 Go 的 Dig 依赖注入框架与 GraphQL 结合使用&#xff0c;可以显著提升应用程序的可维护性、可测试性以及灵活性。 Dig 是一个强大的依赖注入容器&#xff0c;能够帮助开发者更好地管理复杂的依赖关系&#xff0c;而 GraphQL 则是一种用于 API 的查询语言&#xff0c;能够提…...

高等数学(下)题型笔记(八)空间解析几何与向量代数

目录 0 前言 1 向量的点乘 1.1 基本公式 1.2 例题 2 向量的叉乘 2.1 基础知识 2.2 例题 3 空间平面方程 3.1 基础知识 3.2 例题 4 空间直线方程 4.1 基础知识 4.2 例题 5 旋转曲面及其方程 5.1 基础知识 5.2 例题 6 空间曲面的法线与切平面 6.1 基础知识 6.2…...

使用van-uploader 的UI组件,结合vue2如何实现图片上传组件的封装

以下是基于 vant-ui&#xff08;适配 Vue2 版本 &#xff09;实现截图中照片上传预览、删除功能&#xff0c;并封装成可复用组件的完整代码&#xff0c;包含样式和逻辑实现&#xff0c;可直接在 Vue2 项目中使用&#xff1a; 1. 封装的图片上传组件 ImageUploader.vue <te…...

第25节 Node.js 断言测试

Node.js的assert模块主要用于编写程序的单元测试时使用&#xff0c;通过断言可以提早发现和排查出错误。 稳定性: 5 - 锁定 这个模块可用于应用的单元测试&#xff0c;通过 require(assert) 可以使用这个模块。 assert.fail(actual, expected, message, operator) 使用参数…...

解决本地部署 SmolVLM2 大语言模型运行 flash-attn 报错

出现的问题 安装 flash-attn 会一直卡在 build 那一步或者运行报错 解决办法 是因为你安装的 flash-attn 版本没有对应上&#xff0c;所以报错&#xff0c;到 https://github.com/Dao-AILab/flash-attention/releases 下载对应版本&#xff0c;cu、torch、cp 的版本一定要对…...

unix/linux,sudo,其发展历程详细时间线、由来、历史背景

sudo 的诞生和演化,本身就是一部 Unix/Linux 系统管理哲学变迁的微缩史。来,让我们拨开时间的迷雾,一同探寻 sudo 那波澜壮阔(也颇为实用主义)的发展历程。 历史背景:su的时代与困境 ( 20 世纪 70 年代 - 80 年代初) 在 sudo 出现之前,Unix 系统管理员和需要特权操作的…...