This is the mail archive of the
cygwin
mailing list for the Cygwin project.
RE: How to read thumb drive volume label
- From: "Buchbinder, Barry (NIH/NIAID) [E]" <BBuchbinder at niaid dot nih dot gov>
- To: cygwin cygwin <cygwin at cygwin dot com>
- Cc: 'Charles Russell' <worwor at bellsouth dot net>
- Date: Mon, 14 Mar 2011 12:11:33 -0400
- Subject: RE: How to read thumb drive volume label
- References: <4D7E200C.40707@bellsouth.net>
Charles Russell sent the following at Monday, March 14, 2011 10:03 AM
>Is there some way to read the volume label on a USB flash drive?
>Something like blkid in linux?
Something like this?
function label() {
$(cygpath --sysdir)/cmd /c dir ${1}:\\ | \
tr \\r \\n | \
sed -n -e '1s/^ Volume in drive . is //p'
}
Or you could play with
$(cygpath --sysdir)/label.exe
Note that both require that one provides the drive letter.
I hope this was not OT. I apologize for use of tools that come
with Windows, but sometimes I find native tools to be easiest.
- Barry
Disclaimer: Statements made herein are not made on behalf of NIAID.
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple