From 6cad5c85c0e4a2309e4158db4b211fa74e4a5c7e Mon Sep 17 00:00:00 2001 From: BrainwreckedTech <3752022+BrainwreckedTech@users.noreply.github.com> Date: Tue, 11 Jan 2022 05:16:18 -0500 Subject: [PATCH] Fix sorting, rename tmp file --- scsictl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scsictl b/scsictl index f1e84c5..74770cd 100755 --- a/scsictl +++ b/scsictl @@ -35,10 +35,11 @@ case "${1}" in else DEVICE_SZ="${DEV_BYTES}B" fi - echo "${DEV_HCIL} ${DEV_PORT} ${BLOCKDEV} ${DEVICE_SZ} ${DEVICE_ID}" | sort -n >> /tmp/bdmap + echo "${DEV_HCIL} ${DEV_PORT} ${BLOCKDEV} ${DEVICE_SZ} ${DEVICE_ID}" >> /tmp/scsictl done - column -N H:C:I:L,PORT,DEV,SIZE,NAME -t -R2,4 -o" " /tmp/bdmap - rm /tmp/bdmap + sort -n -o /tmp/scsictl /tmp/scsictl + column -N H:C:I:L,PORT,DEV,SIZE,NAME -t -R2,4 -o" " /tmp/scsictl + rm /tmp/scsictl ;; *) echo "Unknown verb '${1}' -- expected delete, list, or rescan"; exit 1;; esac