Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am writing my first udev rule. I read many how tos but can't find a way to assign ATTRS{variable} to ENV{variable}

in order to have access to that variable from RUN

like RUN+="/bin/mkdir/%E{variable}"

because with RUN+="/bin/mkdir/ATTRS{variable}" it doesn't work.

I tried to use $ATTRS{variable}, %ATTRS{variable}, ATTR{serial}, $ATTR{serial}, %ATTR{serial} with no success.

The variable itself exists 100%

thank you...

share|improve this question
up vote 1 down vote accepted

I would delete this question but, probably, this could save one's time

So I used: ENV{variable}="$attr{variable}"

share|improve this answer
i have rndis device. udevadm info --query=all --path=/sys/class/net/rndis0 --attribute-walk shows ATTRS{product}=="ZTE Wireless Ethernet Adapter" in /devices/platform/ehci-platform/usb1/1-1 . how to copy ATTRS{product} to attr{product} ? – eri Apr 4 at 2:04

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.