Saturday, May 4, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 2715  / 3 Years ago, wed, may 12, 2021, 3:23:00

The following works:


$ zip -rj /the/absolute/path/tmp{.zip,}

It produced a file called tmp.zip, saving me the trouble to repeat the folder name as the name of the zip archive.


In my rifle.conf (ranger specific configuration file) I have:


!mime ^text, !ext xml|csv|tex|py|pl|rb|sh|php  = zip -rj "$@"{.zip,}

The "$@" translates to the path. This works fine, I make use of this a lot.

But when I try it, the error I get is:


zip error: Nothing to do! (/the/absolute/path/tmp{.zip,})

This has worked fine for me, too. It only stopped working after upgrading my OS and with it ranger. So there is likely something I am missing here.


$ ranger --version
ranger version: ranger 1.9.3
Python version: 3.8.10 (default, Mar 15 2022, 12:22:08) [GCC 9.4.0]
Locale: en_US.UTF-8

$ cat /etc/upstream-release/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu Focal Fossa"

More From » bash

 Answers
7

What was actually going on here is that ranger does a thing where if you execute files via shortcuts that things are executed as configured. In the case for shell this meant to do a call to "sh".


In previous versions of Linux Mint sh was just symlinked to bash, so the shortcut worked as "bash" in practice, even if if under the hood it was defined as sh.


But in the newer version, sh is no longer symlinked to bash, so you get a different shell and bash scripts throw weird errors, because they aren't executed as bash by the shortcut.


The fix is then to just update the config from sh to bash in the shortcut configuration (rifle.conf).


[#434] Wednesday, May 12, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
wherejuic

Total Points: 53
Total Questions: 123
Total Answers: 117

Location: Zambia
Member since Mon, Jan 23, 2023
1 Year ago
wherejuic questions
Thu, Aug 19, 21, 18:07, 3 Years ago
Sat, Nov 13, 21, 05:27, 3 Years ago
Mon, Sep 5, 22, 17:36, 2 Years ago
Sun, Feb 13, 22, 00:30, 2 Years ago
;