On Thu, Dec 9, 2010 at 9:26 AM, <harald@xxxxxxxxxx> wrote: > From: Harald Hoyer <harald@xxxxxxxxxx> > > $ udevadm info --query=shproperty --name=/dev/sda > UDEV_LOG='3' > DEVPATH='/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda' > MAJOR='8' > MINOR='0' > DEVNAME='/dev/sda' > DEVTYPE='disk' > ... > DEVLINKS='/dev/block/8:0 /dev/disk/by-id/ata-APPLE_SSD_TS128B_60CS105MT4RZ /dev/disk/by-id/scsi-SATA_APPLE_SSD_TS128_60CS105MT4RZ /dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0' > > This enables the use of "eval" in shell scripts: > $ eval $(udevadm info --query=shenv --name=/dev/sda) > $ echo $DEVLINKS > /dev/block/8:0 /dev/disk/by-id/ata-APPLE_SSD_TS128B_60CS105MT4RZ /dev/disk/by-id/scsi-SATA_APPLE_SSD_TS128_60CS105MT4RZ /dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0 Would be nice if you could prefix the resulting environment variables e.g. $ eval $(udevadm info --query=shenv --shprefix=MY_NAMESPACE --name=/dev/sda) $ echo $MY_NAMESPACE_DEVLINKS /dev/block/8:0 /dev/disk/by-id/ata-APPLE_SSD_TS128B_60CS105MT4RZ /dev/disk/by-id/scsi-SATA_APPLE_SSD_TS128_60CS105MT4RZ /dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0 to ensure that no existing variables gets overwritten. You probably also want to patch the man pages. Thanks, David -- 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