[Debian Bug #443703] interpolate variables/~ in incrontab
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.
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.
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.