SHARE
TWEET

detectfs

tolikpunkoff Mar 25th, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. if [ -z "$1" ]; then
  4.     blkid |sed -n 's/\(.*:\).* TYPE=\"\([^\"]*\)\".*/\1\2/p'
  5. else
  6.     RES=`blkid "$1"`
  7.     RC=$?
  8.     if [ $RC -ne 0 ];then
  9.     echo "$1:Not found or not supported (code $RC)"
  10.     else
  11.     RES=`echo "$RES"|sed -n 's/\(.*:\).* TYPE=\"\([^\"]*\)\".*/\1\2/p'`
  12.     if [ -n "$RES" ];then
  13.         echo "$RES"
  14.     else
  15.         echo "$1: Not exist TYPE"
  16.     fi
  17.     fi
  18. fi
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top