|
|
10.5: Mount a partition or volume on demand
It can also be necessary to consider whitespace in partition/volume names under the NAME field, e.g. Macintosh HD for this line:diskutil list returned #: TYPE NAME SIZE IDENTIFIER ... 3: Microsoft Basic Data Windows 48.9 Gi disk0s3 ... So a little tinkering might be necessary depending on filesystem type. 2: Apple_HFS Macintosh HD 54.9 Gi disk0s3And you have to be careful matching names that have the same pre-whitespace prefix. For example, with Boot, Boot i386, Boot ppc volume names the awk '/Boot/…' command will match all three when the intention may be to match Boot. I consider my workarounds for whitespace issues too icky for posting here. Eventually I'll write (or find) a nicer diskutil list output parser/matcher to handle them.
10.5: Mount a partition or volume on demand
And you have to be careful matching names that have the same pre-whitespace prefix. For example, with Boot, Boot i386, Boot ppc volume names the awk '/Boot/…' command will match all three when the intention may be to match Boot.I hadn't considered this, either, but since it's regular expressions it's not too difficult to resolve. if you have multiple volumes with similar names (like your boot, boot i3686, boot ppc) all you need to do is space-pad the regexp; i.e. use /boot / or /boot {3,}/ with a large enough number of spaces to exclude other names. diskutil will always output with space padding (so you don't need to worry about other whitespace), and the regexp won't match shorter names, so this should do the trick. good point, thank you.
10.5: Mount a partition or volume on demand
That's my thinking on it, too. I'm just not code-savvy enough to quickly bang out a clean script. :) |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysNo new commentsLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.09 seconds |
|