Comment by wglb

4 years ago

I still find them annoying, doing lots of work on the command line. I use this hack:

  #!/usr/local/bin/sbcl --script
  (load "~/.sbclrc2")
  (require 'replace-all)
  (in-package :replace-all)


  (format t "file is ~s" (second sb-ext:*posix-argv*) (probe-file (second sb-ext:*posix-argv*)))
  (let* ((args sb-ext:*posix-argv*)
    (orig (second args) )
    (newfn (if orig
      (replace-all orig "(" "-") 
      orig))
    (newfn1 (replace-all newfn ")" "_"))
    (newfn2 (replace-all newfn1 " " "-"))
    (newfn3 (replace-all newfn2 "&" "-"))
    (newfn4 (replace-all newfn3 ":" "-")))
    (when orig
 (format t "renaming \"~a\" to \"~a\"~%" orig newfn4)
 (multiple-value-bind (new-name old-truename true-newname)
  (rename-file orig newfn4)
   (format nil "new-name ~a old-true ~a new true ~a" new-name old-truename true-newname))))