Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the '10.5: Mount a partition or volume on demand' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.5: Mount a partition or volume on demand
Authored by: Ram-Z on Aug 12, '09 02:14:23PM
The && echo... is of course not necessary... I was just using for tests purposes.
The bash script would look like this:

#! /bin/bash
dev_id=`diskutil list | awk '/\\yPARTION_NAME\\y/{ match( $0, /disk[0-9]+(s[0-9]+)?/ ); print substr( $0, RSTART, RLENGTH); }'`
[[ $dev_id ]] && diskutil mount $dev_id

[ Reply to This | # ]