You are not logged in.
I have been using this custom action.
But for a project I needed to rename some .png files to filenames using only spaces and no extension.
zip -u -j %n.zip %F
But now it does not zip those files?
Any fix?
Ubuntu-Mate 24.04
Offline
Hey, the problem is that files containing only spaces break the zip command as currently defined.
A possible solution would be to check whether the %n param is empty and provide a default archive name.
zipname="$(echo %n | xargs)"; zip -u -j "${zipname:-Archive}".zip %F
Breaking down how it works:
1. We assign the %n value to a variable and trim any leading whitespace using xargs
2. Through bash parameter expansion we provide a default value in case zipname is empty - Archive
Offline
Thanks PaperNick.
Ubuntu-Mate 24.04
Offline
[ Generated in 0.010 seconds, 7 queries executed - Memory usage: 519.21 KiB (Peak: 522.8 KiB) ]