Hi. I am using Total Commander v2.80 for Android and experience an error when using custom button-bar buttons that use the %P or %P%N parameters with paths containing round brackets before the final slash of the path. The error does not occur when using %T or %T%M in the inactive panel.
Here is a very basic example that produces the error...
Function type: Send shell command
Command: su
Parameters: *echo "%P%N"
If the path contains round brackets before the final slash I get the following error: sh: <stdin>[1]: syntax error: '(' unexpected
Example of path creating error: /storage/8CE0-6T02/folder_(2017)/file.ext
If the round brackets are only within the final section of the path then there is no error, eg: /storage/8CE0-6T02/folder_(2017)
I have also tried using printf "%s" "%P%N" but the error still occurs. Neither single or double quotes around the parameter seem to help either.
Maybe this is a bug. Thank you for making this great file manager. It is always the first app that I install.
Bug report: Custom button-bar parameter error
Moderators: Hacker, petermad, Stefan2, white
- ghisler(Author)
- Site Admin
- Posts: 50532
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
TC is just passing the name 1:1 to the shell (sh or su). Maybe I need to escape brackets somehow?
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Perhaps escaping all round brackets in file paths might fix this, or maybe quoting all file paths before passing them to the shell. I am still a novice so I'm sorry that I can't really offer any helpful advice.ghisler(Author) wrote:TC is just passing the name 1:1 to the shell (sh or su). Maybe I need to escape brackets somehow?
I like to use custom buttons to pass info from TC to scripts and the terminal emulator. I found a workaround for this problem by using TC's internal command for the button bar 'Full names to clipboard' and then pasting this into the terminal emulator and quoting it.
Also, I incorrectly said that the error does not occur when using these same error producing paths in the inactive panel when using %T%M as parameters. I checked again and the error does also occur with %T%M if the active panel's path also contains round brackets.
-
- New Member
- Posts: 1
- Joined: 2018-03-06, 20:47 UTC
- ghisler(Author)
- Site Admin
- Posts: 50532
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
So far I haven't received any similar reports. Please try to uninstall and then re-install Total Commander.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com