Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@eworm-de
Copy link

No description provided.

No need for a lot of if-else... Just add a backslash if required, then
append the character.
This fixes...

incrond[1714]: cannot exec process: Resource temporarily unavailable

... with bad file name due to messing escaping.
avcbvamorec added a commit to avcbvamorec/incron that referenced this pull request Mar 17, 2023
@anzz1
Copy link

anzz1 commented Sep 6, 2025

The correct way is to only escape the single-quote, and then put the path variables '$@' '$#' in them in commands. Other characters need not be escaped, as they will not be treated as special within single-quoted strings.

See #101

@anzz1
Copy link

anzz1 commented Sep 6, 2025

The way you have done it, when the path variables are in single quotes, everything inside will be treated literally so the literal name of a file containing something like my 'test' file "\\" (nice).txt will become literally my\ \'test\'\ file \"\\\\\"\ \(nice\).txt

The lesson here is always use single quotes for any input in shell, and always only escape the single quote itself within it. This memory rule prevents problems with escaping special characters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants