disk/bdmap
BrainwreckedTech da824eac17 Added bdmap
2019-08-23 20:00:10 -04:00

12 lines
392 B
Bash
Executable File

#!/bin/sh
MKSED=false
OUTPUT="$(ls -l --color=never /sys/block | grep -v virtual | grep devices | cut -d\ -f9- | sed 's/\.\.\/devices\/pci//g;s/[0-9]\{4\}:[0-9]\{2\}[0-9:.a-f]*//g;s/\/\/\/*//g;s/->/=/g' | cut -d/ -f1)"
case "${1}" in
--sed) sed "$(echo ""${OUTPUT}"" | sed 's/ = / (/g;s/\(sd.\)/s\/\1 \\{7\\}\/\1/g;s/ s\//)\/g;s\//g'))/g" /dev/stdin ;;
*) echo "${OUTPUT}" ;;
esac