Welcome to Vifm Q&A, where you can ask questions about Vifm usage. Registration is optional, anonymous posts are moderated. GitHub or Google logins are enabled.
0 votes
in vifm by

I created a command in vifmrc for 7z:

command! mCompressA 7z a -tzip -mx=5 -mmt=8 %f.zip %f

In vifm, I select a file with space like a b.txt and it handles it properly.

Now I move the 7z command to a bash script (mCompress.sh):

#!/bin/bash

7z a -tzip -mx=5 -mmt=8 $@.zip $@

and change the vifmrc to:

command! mCompressA bash mCompress.sh %f

Now, the command can not handle the same file with space a b.txt. I tried %"f and the issue still exists.

Should I do something specific when dealing with bash script?

Thank you

1 Answer

+1 vote
by
selected by
 
Best answer

You need to fix the script:

#!/bin/bash

7z a -tzip -mx=5 -mmt=8 "$1.zip" "$1"
If you would like to make a bug report or feature request consider using GitHub, SourceForge or e-mail. Posting such things here is acceptable, but this is not a perfect place for them.
...