Replace (split-string (shell-command-to-string ...)) with (process-lines ...)