How do I delete the newline from a process output?

前端 未结 4 1281
傲寒
傲寒 2021-01-11 09:39

I call git get the toplevel dir (according to Is there a way to get the git root directory in one command? ).

(let ((tmpbuffer (get-buffer-create (make-temp-         


        
4条回答
  •  逝去的感伤
    2021-01-11 10:00

    If You are OK with awesome external package.

    use s-trim

    ELISP> (shell-command-to-string "light -G")
    "60.00\n"
    
    ELISP> (s-trim (shell-command-to-string "light -G"))
    "60.00"
    

提交回复
热议问题