[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: user menu in midnight commander



On Thu, 2 Feb 2017 23:02:23 +0100
sp113438 <sp113438@telfort.nl> wrote:

> Hi,,
> I have this problem. I have a command:
> 
> find -type f -depth -maxdepth 1 -execdir bash -c ' conv_name=$(printf
> %s "$1" | iconv -f utf8 -t latin1 | iconv -f cp1251);  mv -v -- "$1"
> "$conv_name" ' -- {} ';'
> 
> (it is for the conversion of cyrillic filenames)
> 
> and I want to add it in the user menu of midnight commander.
> It should apply on all files in the open directory.
> 
> Any ideas on how to do this?
> 
> I tried to add this to the user menu, it shows up when F2 pressed, but
> it does not work, it asks for parameters:
> 
> + ! t t
> z       Cyrillic convert
>         CMD=%{find -type f -depth -execdir bash -c '
> conv_name=$(printf %s "$1" | iconv -f utf8 -t latin1 | iconv -f
> cp1251);  mv -v -- "$1" "$conv_name" ' -- {} ';'Enter command} $CMD %t
> 

This doesn't work either:

+ t t
W       CyrConv
        set %t; CMD=%{find -type f -depth -execdir bash -c '
conv_name=$(printf %s "$1" | iconv -f utf8 -t latin1 | iconv -f
cp1251);  mv -v -- "$1" "$conv_name" ' -- {} ';'} 
while [ -n "$1" ]; do
$CMD "$1" 
shift
done



Reply to: