MHN
Add a comment on Hacker News →
2 of 804 comments
  1. It seems to me that many of the problems associated with spaces in filenames are due the OS assuming that a space signals the end of a command or filename.

    Maybe we ought have to a different character signify the end of a name? Or signfiy a option section, or the next option section of a command?

  2. I have an overly-aggressive function in my .bashrc to rename all files in the current directory:

      # Rename all files in a directory
      rn() {
        rename "s/ /-/g" *
        rename "s/_/-/g" *
        rename "s/–/-/g" *
        rename "s/://g" *
        rename "s/\(//g" *
        rename "s/\)//g" *
        rename "s/\[//g" *
        rename "s/\]//g" *
        rename 's/"//g' *
        rename "s/'//g" *
        rename "s/,//g" *
        rename "y/A-Z/a-z/" *
        rename "s/---/--/g" *
        rename "s/-‎--/--/g" *
      }
    
    I use this all the time, especially when I download files.