Hallo, Am Sam, 21 Okt 2006, Al Bogner schrieb:
Am Dienstag, 17. Oktober 2006 00:49 schrieb David Haller:
Die Frage ist nun, wie ich möglichst effizient alle Devices scanne und unter der Bedingung "ID_SERIAL=SWISSBIT_Twist_40479E4643xxxxxx" weitere Befehle ausführe.
for d in `fdisk -l | awk '/^\/dev\/sd/ { print $1; }'`; do eval `udevinfo -q env -n "$d" | grep 'ID_SERIAL'` case "$ID_SERIAL" in [..] da gibt es noch ein Problem und zwar, wenn der Stick keine Partitionstabelle hat.
fdisk -l | awk '/^\/dev\/sd/ { print $1; }' Disk /dev/sda doesn't contain a valid partition table
Für udevinfo reicht auch das Device, also zB /dev/sda. Obiger awk-Befehl gibt aber die Partition sda1 aus.
for d in `awk '/ sd[a-z] / { print "/dev/" $4; }' /proc/partitions`; do Bin mir nicht sicher, ob's /proc/partitions bei 2.6.x gibt. -dnh -- hm. I've lost a machine.. literally _lost_. it responds to ping, it works completely, I just can't figure out where in my apartment it is. -- bash.org/?top