Skip to content

Instantly share code, notes, and snippets.

@evilsneer
Last active April 18, 2021 18:47
Show Gist options
  • Save evilsneer/d177936819d7e139fb7a18b6a360651b to your computer and use it in GitHub Desktop.
Save evilsneer/d177936819d7e139fb7a18b6a360651b to your computer and use it in GitHub Desktop.
clojure sh utils
(defn- -l [host port path]
{:post [(= 0 (:exit %))]}
(->> (sh "ssh" (str user "@" host)
"-p" port
"cd" path
"&&"
"ls -l")))
(defn l-humanize [user host port path]
(->>
(l user host port path)
:out
str/split-lines
rest
(map (fn [file-line]
(->>
(str/split file-line #"\s+")
log/spy
(zipmap [:modes :? :user1 :user2 :size-bytes :month :date :time :name]))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment