Created
July 28, 2013 20:38
-
-
Save somian/6100138 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# get some metadata about present disk devices. | |
function disklookup | |
{ | |
if [[ x"$1 " != x"" ]] | |
then | |
PATT="$1" | |
for LOL in `blkid -o device -t TYPE=ext4` | |
do blkid -o full -s 'UUID' -s 'LABEL' $LOL | |
done | | |
sed -n "/$PATT/{p}" | |
else | |
# Try this | |
for LOL in `blkid -o device -t TYPE=ext4` | |
do echo -n "$LOL " && | |
blkid -o value -s 'LABEL' -s 'UUID' $LOL | |
done | |
fi | |
} | |
declare -x -f disklookup |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Not thoroughly tested. It has helped us to edit /etc/fstab so far.