mirror of
https://gitea.nishi.boats/pyrite-dev/milsko
synced 2026-01-10 11:23:29 +00:00
posix
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@632 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
11
m4/util/afterdot.m4
Normal file
11
m4/util/afterdot.m4
Normal file
@@ -0,0 +1,11 @@
|
||||
dnl $Id$
|
||||
define([afterdot],[pushdef([rindex])dnl
|
||||
define([rindex],index([$1],[.]))dnl
|
||||
define([rindex],ifelse(rindex,[-1],len([$1]),rindex))dnl
|
||||
substr([$1],[0],rindex)$2[]dnl
|
||||
popdef([rindex])])dnl
|
||||
dnl
|
||||
define([afterdots],[pushdef([first])dnl
|
||||
define([first],1)dnl
|
||||
foreach([x],space_to_comma($1),[ifelse(first,[1],[define([first],0)],[ ])afterdot(x,$2)])dnl
|
||||
popdef([first])])dnl
|
||||
@@ -1,3 +1,5 @@
|
||||
dnl $Id$
|
||||
define([space_to_comma],[_space_to_comma(patsubst([$*],[ ],[,]))])dnl
|
||||
define([_space_to_comma],[ifelse([$#],[0],[],[$#],[1],[$1],[$1[,]_space_to_comma(shift($@))])])dnl
|
||||
define([space_to_comma],[pushdef([rindex])dnl
|
||||
define([rindex],index([$*],[ ]))dnl
|
||||
ifelse(rindex,[-1],[$*],[substr([$*],0,rindex)[,]space_to_comma(substr([$*],eval(rindex + 1)))])[]dnl
|
||||
popdef([rindex])])dnl
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
dnl $Id$
|
||||
define([my_syscmd],[syscmd([$1 > my_syscmd_out.out])include(my_syscmd_out.out)syscmd([sh -c "rm -f my_syscmd_out.out"])])dnl
|
||||
define([my_syscmd],[syscmd([$* | tr '\n' ' ' | sed 's/ $//' > my_syscmd_out.out])dnl
|
||||
include(my_syscmd_out.out)[]syscmd([sh -c "rm -f my_syscmd_out.out"])])dnl
|
||||
|
||||
Reference in New Issue
Block a user