dharmik

@dharmik@linuxusers.in

admin @ linuxusers.in.
student. custodian of useless trivia.
hacker. python. c. unix. vim.

bloghttps://dhrm1k.github.io
codeshithttps://github.com/dhrm1k
matrix@spiderham:matrix.org
photos@dharmiik@social.photo

Location: 23.014509,72.591759

81 following, 27 followers

4 ★ 4 ↺

[?]dharmik »
@dharmik@linuxusers.in

TIL how to use $(command) to capture the output of one command and use it in another!

you can get the date as folder name (in format month abbreviate-date-year) with

mkdir "$(date +"%b%d%Y")"

- $(...) is used to execute the date command and substitute its output.

...
dharmik boosted

[?]vintage screwlisp account »
@screwtape@mastodon.sdf.org

@dharmik
In the spirit of sharing
CL-USER>
(ensure-directories-exist
(format nil "~[mon~;tue~;wed~;thu~;fri~;sat~;sun~]/"
(nth-value 6 (get-decoded-time))))
"thu/"
T
CL-USER> (probe-file "thu/")
"/home/screwtape/thu/"

tl;dr a lisp form to create an abbreviated current-day-of-the-week-shortname directory by decoding the current universal-time.

    ...
    1 ★ 0 ↺

    [?]dharmik »
    @dharmik@linuxusers.in

    In the spirit of sharing

    the spirit of sharing is always appreciated. :)

      dharmik boosted

      [?]Reid :ablobcatattention: »
      @Reiddragon@fedi.reimu.info

      @dharmik fun fact: you can also use <(command) to take the output of command and feed it as a file argument to another command

      eg. vimdiff <(command1) <(command2) (for all vim cares, those are read-only files passed as arguments)

        ...

        History