docs clarification
[hband-tools.git] / user-tools / lsata
blob4f21e60758d67542bcfd0902336e6436b65da42d
1 #!/bin/bash
3 true <<EOF
4 =pod
6 =head1 NAME
8 lsata - List ATA devices on the system
10 =cut
12 EOF
15 for lnk in /sys/block/sd*
17 dev=${lnk##*/}
18 trg=`readlink -f "$lnk"`
19 path=`sed -e 's@\(.\+\)/host[0-9]\+.*@\1@' <<<"$trg"`
20 hostnum=`sed -e 's@.\+/host\([0-9]\+\).*@\1@' <<<"$trg"`
21 echo "$dev $(cat $path/host$hostnum/scsi_host/host$hostnum/unique_id) $path/host$hostnum/scsi_host/host$hostnum"
22 done