Hello, On Sun, 25 Aug 2019, Carlos E. R. wrote:
I need to copy some files to an USB stick (FAT). The problem is, the files have a ":" on their names, and Thunar (XFCE) says the name is invalid, but does not offer as an option to change the name. [..] Midnight commander does not allow edit. Well, it does, in a cumbersome manner.
Try this in your local/user/system menu-extension file (F9 -> c -> m -> [local/user/system]): ==== the "F" at the start of each second line is the shortcut ==== + ! t t F cp-rename to FAT-compatible filenames to=$(echo "%f" | tr ':\\' '__') cp "%d/%f" "%D/$to" + t t F cp-rename to FAT-compatible filenames for i in %s ; do to=$(echo "$i" | tr ':\\' '__') cp "%d/$i" "%D/$to" done ==== The use "F2", "F" to copy the selected file(s) to the other directory. You could also add recode/iconv into the mix to convert filenames, but that should be handled by the iocharset of the fat-mount. ISTR, that ':' and '\' are the only chars disallowed on FAT (modulo the charset and up-/downcase collisions handled by the kerneldriver). Anyway, you can basically do lots instead of that simple 'tr'. Tested with: $ ls * a: b:ö b:ö\x ä:x ä:y b: b_ö b_ö_x ä_x ä_y and copying one/all files from ./a to ./b using 'mc a b'... IMO, the most difficult part is choosing an appropriate menu-key ;) HTH, -dnh -- Linux: the operating system with a CLUE... Command Line User Environment. -- seen in a posting in comp.software.testing -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org