Created
September 2, 2013 11:26
-
-
Save somian/6411884 to your computer and use it in GitHub Desktop.
A slightly more useful stab at the previous gist.
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
blkid -s TYPE|egrep vfat | cut -d \: -f 1| xargs /sbin/blkid -c value| | |
xargs perl -MCarp -MFile::Util="" -e '$it=File::Util->new();' \ | |
-e 'my($lab)= grep{$_} map{/LABEL=([^=]+)(?=[[:space:]][[:upper:]]+[=])*/;' \ | |
-e '($1 ? do{($_=$it->escape_filename($1))=~s{[[:space:]]}{_}g and qq[/media/byLABELISH/$_]}' \ | |
-e ': q[])} grep {LABEL} @ARGV; print qq[We shall try to make $lab if it does not exist.\n];' \ | |
-e 'unless (-d $it){$it->make_dir($lab) || croak qq[Well, that failed somehow.\n]}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment