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
- DM="`dmesg | grep -i 'scsi' | grep -i removable`";
- FD="`fdisk -l | grep -i disk | grep -i media`";
- DI="`df -h`";
- # Parse the DMESG cmd for Drive location and set VAR SDDRV
- echo "DM => " ${DM};
- # Parse the FDISK cmd for Drive Name and Size using ${SDDRV}
- #echo ${FD} | od -bc;
- echo "FD => " ${FD};
- #while true; do sudo ${DM}; done\
- # Get Flash name based on size value
- # Parse the DF cmd for the Drive available space and mount point using ${SDDRV}
- echo "DI => " ${DI};
- exit 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement