Re: problem executing command substitution from udev rules

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Nov 2, 2010 at 9:34 AM, J. Bakshi <j.bakshi@xxxxxxxxxxxxxxxxx> wrote:
>  it works well.  But if I try to add command substitution ( with in back-qoutes ) to dynamically collect the user name , it stops working. The rule is like
>
> ```````````````
>  ACTION=="add", SUBSYSTEM=="input", ENV{ID_CLASS}="mouse", ENV{DISPLAY}=":0.0", ENV{XAUTHORITY}="/home/user1/.Xauthority"  RUN+="/bin/su  `ps aux | grep startx | grep '/bin/sh' | awk '{print $1}'`  -c "DISPLAY=:0.0 notify-send "test"  "
>  ``````````````````````````
>

I do not think udev is using shell to start external commands. You
will need to use something like

RUN+="/bin/sh -c '...'"

Quoting will quickly become unmanageable I am afraid :)
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel]     [Linux DVB]     [Asterisk Internet PBX]     [DCCP]     [Netdev]     [X.org]     [Util Linux NG]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux