(In reply to Thomas Blume from comment #24) > > KERNEL=="nvme*", ENV{DEVTYPE}=="disk", IMPORT{program}="/bin/sh -c > 'ID_SERIAL=$env{ID_SERIAL}; echo ID_SERIAL_TRUNCATED=${ID_SERIAL:0:16}'" > > leaves ID_SERIAL_TRUNCATED empty: > > because ID_SERIAL is not present in the shell environment. Well that was an example which was supposed to show that string mangling could be inlined in the rule file. ID_SERIAL or whatever that needs to be used, is supposed to be retrieved from sysfs by using the "$attr{xxx}" syntax. Please note that we should make sure to not pollute the environment that is already setup by the upstream rules. Therefore setting ID_SERIAL or ID_MODEL in 61-xxx is not a good idea.