|
From: | Stefan Israelsson Tampe |
Subject: | Re: grep and sed in guile |
Date: | Tue, 27 Aug 2013 17:24:54 +0200 |
> 3) (sed m expr)FWIW Guix has a sed-like macro, called ‘substitute*’ [0]. Example:
>
> This will print out on std output all lines not matched by m, if m is
> matched then that expr will make sure to print the correct way
>
> An example matcher is
> m := (s-tr a b)
>
> which will replace a by b
(substitute* "my-file.txt"
(("^(.*) world$" _ first-word)
(string-append "Hello (was: " first-word ") world\n")))
Ludo’.
[0] http://git.savannah.gnu.org/cgit/guix.git/tree/guix/build/utils.scm#n387
[Prev in Thread] | Current Thread | [Next in Thread] |