incron icon indicating copy to clipboard operation
incron copied to clipboard

[Debian Bug #443703] interpolate variables/~ in incrontab

Open k0lter opened this issue 11 years ago • 2 comments

This bug report is a copy of https://bugs.debian.org/443703

[martin f krafft]

Please let me use ~ (or $HOME) and other variables in incrontab table entries. I am really not a fan of hardcoding the path to my homedirectory.

k0lter avatar Mar 29 '15 07:03 k0lter

Added to the wishlist. For now, this can always be done by putting the command in a shell script and call that script in incron.

ar- avatar Mar 30 '15 03:03 ar-

Hello, this can be considered as a bug. If you run a Python script (and some other language) directly with incrontab like this : /path/to/file IN_CLOSE_WRITE /path/to/myscript.py $# $@ This will not work if $# or $@ contains non-ASCII filenames because as it is written in the manual : "the whole environment is cleared and then only these variables are set: LOGNAME, USER, USERNAME, SHELL, HOME and PATH." The variable LANG is disabled, by default the locals will be Posix (ASCII) not allowing to work with file names in UTF-8. So I have to use the following workaround: run a shell script with incrontab, enable the environment variables in the shell script, and run the python script from the shell script.

Daudre-Vignier-Charles avatar Mar 10 '18 10:03 Daudre-Vignier-Charles