From 7e7284ea02548845b9f15b2e1aa5efda5280c80c Mon Sep 17 00:00:00 2001 From: BrainwreckedTech <3752022+BrainwreckedTech@users.noreply.github.com> Date: Mon, 10 Jan 2022 22:46:03 -0500 Subject: [PATCH] Improved bdmap output --- bdmap | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bdmap b/bdmap index 8f48ba1..944bdff 100755 --- a/bdmap +++ b/bdmap @@ -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')"