If I'm in eshell I can run elisp commands cause I'm in an elisp runtime
(mapcar (lambda (x) (* x 3)) (list 1 2 3))
(3 6 9)
I can also run "shell" commands such as git status
. But what if I wanted to take the output of my git status
and pass it into a mapcar
. How would I do that?
(let ((result (shell-command-to-string "git status"))) (stringp result))
That example will returnt
at the eshell command prompt. In terms of plugging that into your example, more details would be needed to know whether the result needs to be converted to a list for the SEQUENCE argument ofmapcar
or whether it would be plugged into the FUNCTION argument ofmapcar
. – lawlist Jun 26 '17 at 22:28shell-command-to-string
seems to be what I needed (I'm just going to split by newline) Thanks! If you move it to an answer I'll mark it as answered. – George Mauer Jun 26 '17 at 22:36