Enable using of #[expr] syntax in conditionals
[guile-bash.git] / README
blob1eb9a89c34277cd331ae18743daf487bba4ad6ab
1 guile-bash
2 ==========
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:
9 - aliases
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?))
26     #$ [exec tmux -2])
27   (dtach-start-emacs)
28   (when (equal? "/dev/tty1" #$(tty))
29     #$[exec /usr/bin/fbterm -- /usr/bin/env TERM=fbterm tmux new])
30   (when with-tmux?
31     #$[source ~/.dircolors.sh]))
33 (let ((availiable-locales (string-split #$(locale -a) #\newline)))
34   (let/ec escape
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)
39           #$[export LC_ALL]
40           (escape (set! #$LC_ALL locale)))))))
42 (for-each append-to-path
43           (list (~ "~a/scripts" +rc-root+)
44                 #$(echo ~/.cabal/bin)
45                 #$(echo ~/.local/bin)))