summaryrefslogtreecommitdiff
path: root/mh/tests
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2013-02-16 11:41:47 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2013-02-16 11:49:24 +0200
commit375ffa14056f4165c9674fa94c243bd632c43742 (patch)
treeb4503acdd526c1d74ea79aaeb5f1df62efabe16e /mh/tests
parentefa513048a74fca2e3ab1b16cc927f8331347f75 (diff)
downloadmailutils-375ffa14056f4165c9674fa94c243bd632c43742.tar.gz
mailutils-375ffa14056f4165c9674fa94c243bd632c43742.tar.bz2
ali: executable file inclusion.
The "< file" construct tests if file is executable and begins with the shell interpreter magic (#!/ or #! /). If so, this file is executed and its output is collected. This provides a way for building aliases on the fly. * mh/mh_alias.l (buffer_ctx) <exec_p>: New member. (exec_p): New static variable. (push_source): If the file is executable and begins with the "#!/" magic, run it and collect its output. (pop_source): Use exec_p to decide how to close the file. * mh/tests/ali.at: Test executable file inclusion. * NEWS: Update.
Diffstat (limited to 'mh/tests')
-rw-r--r--mh/tests/ali.at12
1 files changed, 8 insertions, 4 deletions
diff --git a/mh/tests/ali.at b/mh/tests/ali.at
index 98cd4771a..ff9ee911d 100644
--- a/mh/tests/ali.at
+++ b/mh/tests/ali.at
@@ -108,15 +108,19 @@ ali -list -a ./mh_aliases everybody
[0],
[expout])
-MH_CHECK([ali: simple aliases],[ali00],[
+MH_CHECK([ali: executable file inlcusion],[ali02 ali-xinclude],[
+AT_DATA([Mail/ali.sh],[#! /bin/sh
+echo "admin: gray, jeff"
+])
+chmod +x Mail/ali.sh
AT_DATA([mh_aliases],[
-devel: gray, polak
-admin: gray, jeff
+devel: gray, polak, admin
+<ali.sh
])
ali -a ./mh_aliases devel
],
[0],
-[gray, polak
+[gray, polak, gray, jeff
])
m4_popdef[MH_KEYWORDS])

Return to:

Send suggestions and report system problems to the System administrator.