Tom Willemse
88b6ba1760
Other file headers come with caveats: - ‘#!/usr/bin/scsh -s’ :: Now that scsh is installed through Guix, this is not where this file lives. - ‘#!/usr/bin/env -S scsh -s’ :: This doesn't work when we need to specify move arguments on the command line and need to use the meta-argument. ‘env -S scsh \’ doesn't work.
17 lines
436 B
Scheme
Executable file
17 lines
436 B
Scheme
Executable file
#!/usr/bin/env sh
|
|
# -*- mode: scheme; -*-
|
|
IFS=" "
|
|
exec scsh -s "$0" "$@"
|
|
!#
|
|
|
|
(define mail-root (string-append (getenv "HOME") "/documents/mail"))
|
|
|
|
(define unread-emails
|
|
(run/sexp (pipe (find ,mail-root -type f -name "*:2,*" -and -not -name "*:2,*S*")
|
|
(wc -l))))
|
|
|
|
(define new-emails
|
|
(run/sexp (pipe (find ,mail-root -type f -wholename "*/new/*")
|
|
(wc -l))))
|
|
|
|
(display (+ unread-emails new-emails))
|