4 Guile-bash project provides shared library and set of Guile modules,
5 allowing you to extend Bash with lisp. You have means to access everything
6 in Bash process and the following aspects are given interface in scheme-spirit
7 without need to know anything about Bash internals:
10 - setting and getting Bash variables
11 - creating dynamic variables
12 - creating bash function with Scheme implementation
13 - reader macro for output capturing
14 - reader macro for evaluating raw bash commands
16 This is fragment of my bash configuration:
18 (for-index [ix <- (1 .. 9)]
19 (add-alias (~ "aw~d" ix) (~ "awk '{ print $~d }' " ix)))
21 (with-everything-catched
22 (for-list (bin = emacs tmux fbterm env dtach)
23 (unless (availiable? bin)
24 (error 'required-program-is-not-availiable bin)))
25 (when (and with-X? (not with-tmux?))
28 (when (equal? "/dev/tty1" #$(tty))
29 #$[exec /usr/bin/fbterm -- /usr/bin/env TERM=fbterm tmux new])
31 #$[source ~/.dircolors.sh]))
33 (let ((availiable-locales (string-split #$(locale -a) #\newline)))
35 (for-list (lang = eo eo_XX ru_RU en_US C)
36 (for-list (enc = UTF-8 utf8)
37 (define locale (~ "~a.~a" lang enc))
38 (when (member locale availiable-locales)
40 (escape (set! #$LC_ALL locale)))))))
42 (for-each append-to-path
43 (list (~ "~a/scripts" +rc-root+)
45 #$(echo ~/.local/bin)))