From: John E. D. <da...@sp...> - 2009-11-09 16:57:34
|
Michael Wagner <mic...@we...> wrote: > is it possible in 'slrn' that it expands variables in the headers like > for example 'mutt'? > > For example I have in my 'muttrc': > > my_hdr X-Operating-System: Debian GNU/`uname -s` `cat /etc/debian_version` = > `uname -r` > > You can see above in my headers that 'mutt' expands the variables. You cannot do this directly in the .slrnrc file, but you can do it in a file that is loaded using the "interpret" command. e.g., % .slrnrc . . set macro_directory ("/home/michael/lib/slrn"); interpret customheaders.sl . . Then in /home/michael/lib/slrn/, create a file called customheaders.sl that contains: private define backtick_expand (cmd) { variable fp = popen (cmd, "r"); if (fp == NULL) return ""; variable str = strjoin (fgetslines (fp), ""); () = pclose (fp); if (str == NULL) return ""; return strcompress (str, " \n"); } private variable Kernel = backtick_expand("uname -s"); private variable Version = backtick_expand("cat /etc/debian_version"); set_string_variable ("custom_headers", "X-Operating-System: Debian GNU/$Kernel $Version"$); set_string_variable ("followup_custom_headers", "X-Operating-System: Debian GNU/$Kernel $Version"$); --John |