diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2021-01-29 15:27:41 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2021-01-29 15:27:41 +0200 |
commit | a67fd17513da4bbc93c8f3df1584557c08af53b2 (patch) | |
tree | 671656fd0126f8f167688237e47059b58dcddc12 | |
parent | 4d38d3a5b9f86b99db8e1853f5412d9d8d033790 (diff) | |
download | m4env-a67fd17513da4bbc93c8f3df1584557c08af53b2.tar.gz m4env-a67fd17513da4bbc93c8f3df1584557c08af53b2.tar.bz2 |
-rw-r--r-- | m4env.c | 29 |
1 files changed, 29 insertions, 0 deletions
@@ -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> |