Improved bdmap output

master
BrainwreckedTech 3 years ago
parent 0f6348e0a1
commit 7e7284ea02

@ -6,11 +6,14 @@ BLK_INFO="$(ls -l --color=never /sys/block | grep -v virtual | grep devices | se
# STRIP OFF THE PCI BUS LOCATION INFORMATION
BLK_INFO="$(echo "${BLK_INFO}" | sed 's|\.\.\/devices/pci[0-9a-f:]\{7\}\(/[0-9a-f:.]\{12\}\)\+/||g')"
#STRIP OFF THE SUPERFLUOUS USB HOST INFORMATION
# STRIP OFF THE SUPERFLUOUS USB HOST INFORMATION
BLK_INFO="$(echo "${BLK_INFO}" | sed 's|\(usb[0-9]\+\)/.*/host|\1/host|g')"
# CONDENSE THE TARGET INFORMATION
BLK_INFO="$(echo "${BLK_INFO}" | sed 's|target[0-9:]\+/[0-9:]\+:\([0-9]\+\)|target\1|g')"
# STRIP OFF THE SUPERFLUOUS TARGET INFORMATION
BLK_INFO="$(echo "${BLK_INFO}" | sed 's|/target\([0-9]\+\):\([0-9]\+\):\([0-9]\+\)/|/|g')"
# EXPAND THE SCSI INFORMATION
BLK_INFO="$(echo "${BLK_INFO}" | sed 's|\([0-9]\+\):\([0-9]\+\):\([0-9]\+\):\([0-9]\+\)|ch\2/id\3/lun\4|g')"
# STRIP OFF BLOCKS
BLK_INFO="$(echo "${BLK_INFO}" | sed 's|/block/.*||g')"

Loading…
Cancel
Save