size=$(lsblk -d -n -o SIZE "/dev/$device" 2>/dev/null) mountpoint=$(lsblk -n -o MOUNTPOINT "/dev/$name" 2>/dev/null)
Optimization: Single call with multiple columns:
read -r size mountpoint type < <(lsblk -d -n -o SIZE,MOUNTPOINT,TYPE "/dev/$device")
No dependencies set.
The note is not visible to the blocked user.
Called multiple times for same device
size=$(lsblk -d -n -o SIZE "/dev/$device" 2>/dev/null)
mountpoint=$(lsblk -n -o MOUNTPOINT "/dev/$name" 2>/dev/null)
Optimization: Single call with multiple columns:
read -r size mountpoint type < <(lsblk -d -n -o SIZE,MOUNTPOINT,TYPE "/dev/$device")