Sample string from my mdev.conf: dvb[0123]\..* 0:0 660 @N=${MDEV%.*}; N=${N#dvb}; D=${MDEV#dvb?.}; mkdir -p dvb/adapter${N}; chmod 755 dvb dvb/adapter${N}; mv MDEV dvb/adapter${N}/${D} Executing that cmd on corresponding event causes error: sh: syntax error: missing '}' After some tracing it looks like '#' is treated as start of comment. in util-linux/mdev.c: if (ENABLE_FEATURE_MDEV_EXEC && command) { /* setenv will leak memory, use putenv/unsetenv/free */ char *s = xasprintf("%s=%s", "MDEV", node_name); char *s1 = xasprintf("%s=%s", "SUBSYSTEM", G.subsystem); putenv(s); putenv(s1); ------> bb_error_msg("\n*** trying to exec '%s' ***\n", command); if (system(command) == -1) bb_perror_msg("can't run '%s'", command); bb_unsetenv_and_free(s1); bb_unsetenv_and_free(s); free(command); } Resulting output: mdev: *** trying to exec 'N=${MDEV%.*}; N=${N' *** sh: syntax error: missing '}' mdev: *** trying to exec 'N=${MDEV%.*}; N=${N' *** sh: syntax error: missing '}'
Created attachment 3956 [details] Proposed patch
Fixed in git: http://git.busybox.net/busybox/commit/?id=499597d6efb0de5bb6d6f52bda1f348478d7f5a9