I'm trying to create a udev rule that sets an variable and uses it in add and remove rules, from what I can see, udev populates the variable but the rules doesn't matches. I've tried with distinct ways (seen in the rule file below).

I don't know udev rules well, but as a workaround: You can specify less rules so that it will much more than once. Udev sets envvars to the triggered scripts. Use "printenv" to see what happens each time the script is called. (Messy, but a good last resort.)_________________Easy Shift / Ctrl / AltGr ... hack; save your pinkies, type without drudge: topic 865313

I don't know udev rules well, but as a workaround: You can specify less rules so that it will much more than once. Udev sets envvars to the triggered scripts. Use "printenv" to see what happens each time the script is called. (Messy, but a good last resort.)

there is another simpler solution than what you have suggested, remove the last_rule option, pass ENV{ID_FS_UUID} to the script and handle all there.
but I'd like to exhaust the above approach if possible first._________________Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein
ProjectFootball