Unmount media bash

technology.pngYup, I’m sharing programming this week. And probably pictures. It’s the first week back to school, and though I made one deadline, I’ve got two others smacking me in the face. So here’s another bit of bash scripting that makes my life easier: unmounting all removable media (with y/n options) without having to mess with Nautilus. Escape colors used, of course.

I’ve posted it on pastebin.

It’s also a good example of (working) nested case statements – looping through the files in a directory, choosing whether or not to work on them (obviously, I like my home directory mounted and /media/ISO is where I mount ISO images), and then giving the user the option of unmounting or not.

Popular posts:

  • If there's one Nazi (or a racist) at the table...
  • Word Porn Quotes
  • The difference between boundaries and rules
  • Identifying the Common Brain Weasel
  • SOLVED: Command line BPM (beats per minute) Analysis in Linux
  • "The greatest waste in the world is the difference between what we are and what we could become." -Ben Herbster
  • Organizing and Tiling Your Windows on #Openbox Using Only... Openbox

Recent Posts