Last active
April 18, 2021 18:47
-
-
Save evilsneer/d177936819d7e139fb7a18b6a360651b to your computer and use it in GitHub Desktop.
clojure sh utils
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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