aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2021-01-29 15:27:41 +0200
committerSergey Poznyakoff <gray@gnu.org>2021-01-29 15:27:41 +0200
commita67fd17513da4bbc93c8f3df1584557c08af53b2 (patch)
tree671656fd0126f8f167688237e47059b58dcddc12
parent4d38d3a5b9f86b99db8e1853f5412d9d8d033790 (diff)
downloadm4env-a67fd17513da4bbc93c8f3df1584557c08af53b2.tar.gz
m4env-a67fd17513da4bbc93c8f3df1584557c08af53b2.tar.bz2
Add license & descriptive headerHEADmaster
-rw-r--r--m4env.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/m4env.c b/m4env.c
index 0838e86..de98f9c 100644
--- a/m4env.c
+++ b/m4env.c
@@ -1,3 +1,32 @@
+/*
+ * NAME
+ * m4env - run m4 with environment variables accessible as macros
+ *
+ * SYNOPSIS
+ * m4env [OPTIONS] [FILES]
+ *
+ * DESCRIPTION
+ * Modifies the command line by replacing argv[0] with "m4" and
+ * inserting a "-D" option for each environment variable before
+ * the original argv[1]. Then execs m4 (from the PATH) with
+ * the created command line.
+ *
+ * As a result, each environment variable is available for expansion
+ * as a m4 macro with the same name.
+ *
+ * E.g,
+ *
+ * echo "Your user name is LOGNAME" | m4env
+ *
+ * AUTHOR
+ * Sergey Poznyakoff
+ *
+ * LICENSE
+ * "THE BEER-WARE LICENSE" (Revision 42):
+ * <gray@gnu.org> wrote this file. As long as you retain this notice you
+ * can do whatever you want with this stuff. If we meet some day, and you
+ * think this stuff is worth it, you can buy me a beer in return.
+ */
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

Return to:

Send suggestions and report system problems to the System administrator.