Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I would like to copy/rename (F5/F6) with regex (regular expression) mask all the tagged files or directories with names containing space or á or é characters replaced with underscore and a and e characters?

Ex:

an á and another á directory name

an á and é file.txt

=>

an_a_and_another_a_directory_name

an_a_and_e_file.txt

(mc -V 4.8.1 on Ubuntu 12.04)

share|improve this question
    
Do you have to do this with mc or would a bash solution be acceptable? –  terdon Sep 16 '12 at 12:06
    
@terdon I wonder if MC has the ability to replace arbitrary characters like perl or sed has with /g (global replace) flag. –  rid Sep 16 '12 at 12:17
    
No idea, I don't use it. Would be happy to give a BASH/find solution if you're interested. –  terdon Sep 16 '12 at 12:21
    
@terdon - Thanks for trying to help. I could write a small user menu script for mc with sed for ex: echo "an á and another á directory name" | sed 's/ /_/g; s/á/a/g; s/é/e/g;' # => an_a_and_another_a_directory_name ...but I would like to find out how to use the regex support bundled in mc for copy/replace functionality. –  rid Sep 16 '12 at 13:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.