Re: X header in postings
"John E. Davis" <[email protected]>
| Newsgroups | gmane.network.slrn.user |
|---|---|
| Message-ID | <[email protected]> |
Michael Wagner <[email protected]> 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 ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july