当前位置: 首页 > 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;请勿恶意转载抄袭…...

多云管理“拦路虎”:深入解析网络互联、身份同步与成本可视化的技术复杂度​

一、引言&#xff1a;多云环境的技术复杂性本质​​ 企业采用多云策略已从技术选型升维至生存刚需。当业务系统分散部署在多个云平台时&#xff0c;​​基础设施的技术债呈现指数级积累​​。网络连接、身份认证、成本管理这三大核心挑战相互嵌套&#xff1a;跨云网络构建数据…...

业务系统对接大模型的基础方案:架构设计与关键步骤

业务系统对接大模型&#xff1a;架构设计与关键步骤 在当今数字化转型的浪潮中&#xff0c;大语言模型&#xff08;LLM&#xff09;已成为企业提升业务效率和创新能力的关键技术之一。将大模型集成到业务系统中&#xff0c;不仅可以优化用户体验&#xff0c;还能为业务决策提供…...

超短脉冲激光自聚焦效应

前言与目录 强激光引起自聚焦效应机理 超短脉冲激光在脆性材料内部加工时引起的自聚焦效应&#xff0c;这是一种非线性光学现象&#xff0c;主要涉及光学克尔效应和材料的非线性光学特性。 自聚焦效应可以产生局部的强光场&#xff0c;对材料产生非线性响应&#xff0c;可能…...

遍历 Map 类型集合的方法汇总

1 方法一 先用方法 keySet() 获取集合中的所有键。再通过 gey(key) 方法用对应键获取值 import java.util.HashMap; import java.util.Set;public class Test {public static void main(String[] args) {HashMap hashMap new HashMap();hashMap.put("语文",99);has…...

centos 7 部署awstats 网站访问检测

一、基础环境准备&#xff08;两种安装方式都要做&#xff09; bash # 安装必要依赖 yum install -y httpd perl mod_perl perl-Time-HiRes perl-DateTime systemctl enable httpd # 设置 Apache 开机自启 systemctl start httpd # 启动 Apache二、安装 AWStats&#xff0…...

el-switch文字内置

el-switch文字内置 效果 vue <div style"color:#ffffff;font-size:14px;float:left;margin-bottom:5px;margin-right:5px;">自动加载</div> <el-switch v-model"value" active-color"#3E99FB" inactive-color"#DCDFE6"…...

ffmpeg(四):滤镜命令

FFmpeg 的滤镜命令是用于音视频处理中的强大工具&#xff0c;可以完成剪裁、缩放、加水印、调色、合成、旋转、模糊、叠加字幕等复杂的操作。其核心语法格式一般如下&#xff1a; ffmpeg -i input.mp4 -vf "滤镜参数" output.mp4或者带音频滤镜&#xff1a; ffmpeg…...

智能仓储的未来:自动化、AI与数据分析如何重塑物流中心

当仓库学会“思考”&#xff0c;物流的终极形态正在诞生 想象这样的场景&#xff1a; 凌晨3点&#xff0c;某物流中心灯火通明却空无一人。AGV机器人集群根据实时订单动态规划路径&#xff1b;AI视觉系统在0.1秒内扫描包裹信息&#xff1b;数字孪生平台正模拟次日峰值流量压力…...

企业如何增强终端安全?

在数字化转型加速的今天&#xff0c;企业的业务运行越来越依赖于终端设备。从员工的笔记本电脑、智能手机&#xff0c;到工厂里的物联网设备、智能传感器&#xff0c;这些终端构成了企业与外部世界连接的 “神经末梢”。然而&#xff0c;随着远程办公的常态化和设备接入的爆炸式…...

AI+无人机如何守护濒危物种?YOLOv8实现95%精准识别

【导读】 野生动物监测在理解和保护生态系统中发挥着至关重要的作用。然而&#xff0c;传统的野生动物观察方法往往耗时耗力、成本高昂且范围有限。无人机的出现为野生动物监测提供了有前景的替代方案&#xff0c;能够实现大范围覆盖并远程采集数据。尽管具备这些优势&#xf…...