Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /bin/bash
- # Author: Nyle Davis Created 14-06-04
- # Purpose: Get Size of any/all USB Flash drives.
- # Return: VAR containing 1.) Drive Name, 2.) Drive Size
- # 3.) Space Available, 4.) Mount Point
- # File: drive-size.sh
- FD="`fdisk -l | grep -i disk | grep -i media`";
- DI="`df -h`";
- DM="`dmesg | grep -i 'scsi' | grep -i sd`";
- # Parse the DMESG cmd for Drive location and set VAR SDDRV
- echo ${DM};
- # Parse the FDISK cmd for Drive Name and Size using ${SDDRV}
- #echo ${FD} | od -bc;
- echo ${FD};
- # Parse the DF cmd for the Drive available space and mount point using ${SDDRV}
- echo ${DI};
- exit 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement