Hello, everybody, I cannot figure out how to pass positional arguments of a macro to esyscmd. I tried googling but found no examples beyond simple calls like esyscmd(`date'). In my case the shell command depends on positional arguments: I want to write macro like _MY_MACRO(var1,var2) that expands to ``var1 : some-text-generated-using-var2'', where ``some-text-generated-using-var2'' is an output of my perl script ``./script.pl var2''.
The first thing I tried was: m4_define(`_MY_MACRO', `$1 : 'm4_esyscmd(`./script.pl '$2)) It does not work, and the scipt diagnostics shows that it was called without any argument. I also tried m4_esyscmd(`./script.pl $2'), m4_esyscmd(./script.pl $2), but none of them worked. Though, if I write something like m4_define(`_MY_MACRO', `$1 : '(`./script.pl '$2)) the shell command is displayed correctly: ``./script.pl var2''. So, I suppose, esyscmd expands its arguments in a different way, than that of a normal macros, or probably, the positional parameters are treated differently. The question is how I may call esyscmd and have all its arguments expanded. I would appreciate any clue or advise, or a workaround. Sincerely yours, Sergey Astanin. _______________________________________________ M4-discuss mailing list [email protected] http://lists.gnu.org/mailman/listinfo/m4-discuss
