Skip to content

Instantly share code, notes, and snippets.

@mbklein
Last active December 28, 2015 10:39
Show Gist options
  • Save mbklein/7487544 to your computer and use it in GitHub Desktop.
Save mbklein/7487544 to your computer and use it in GitHub Desktop.
mount_map = Hash[
`mount`.split(/\n/).collect { |l|
(loc, mount, type) = l.scan(/^(.+) on (.+) type (\S+) /).flatten
if loc =~ /:\//
loc = "#{type}://#{loc.sub(/:\//,'/')}"
[mount, loc]
end
}.compact
]
@mbklein
Copy link
Author

mbklein commented Nov 15, 2013

=> {"/usr/local/masterfiles"=>"nfs://avalon-mhorn-dev.library.northwestern.edu/usr/local/masterfiles/"}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment