   (interactive)
   (dwim-shell-command-on-marked-files
    "Convert to jpg"
-   "convert -verbose <<f>> <<fne>>.jpg"
+   "convert -verbose '<<f>>' '<<fne>>.jpg'"
    :utils "convert"))
 
 (defun dwim-shell-command-convert-image-to-png ()


    Given FILE \"path/to/image.png\"

    \"convert <<f>> <<fne>>.jpg\"

    yields



Use POST-PROCESS-TEMPLATE to further expand template given own logic."
  (setq file (expand-file-name file))
  ;; "<<fne>>" with "/path/tmp.txt" -> "/path/tmp"
  (setq template (replace-regexp-in-string "\\(\<\<fne\>\>\\)" (file-name-sans-extension file) template nil nil 1))

  ;; "<<e>>" with "/path/tmp.txt" -> "txt"
  (setq template (replace-regexp-in-string "\\(\<\<e\>\>\\)" (file-name-extension file) template nil nil 1))

  ;; "<<f>>" with "/path/file.jpg" -> "/path/file.jpg"
  (setq template (replace-regexp-in-string "\\(\<\<f\>\>\\)" file template nil nil 1))
  (when post-process-template
    (setq template (funcall post-process-template template file)))
  template)
