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


Click here to return to the 'Need help to eject and mount partitioned firewire drives' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Need help to eject and mount partitioned firewire drives
Authored by: groundspeed on Apr 25, '04 10:30:20PM

I have an external firewire drive with two partitions. Normally I can eject or mount them from terminal like this:
-disktool -l ( this lists all their device numbers)
-disktool -m disk2s10 disk2s9 (mounts both partitions)

I want to use this shell script except for both devices but can't figure out the syntax to insert the space between the device numbers:

do shell script "disktool -m `disktool -l | grep 'Partition 1' | awk '{ print substr($0,20,7) }'` "

I need to stick this part after a space for the second device:
`disktool -l | grep 'Partition 2' | awk '{ print substr($0,20,8) }'`

Notice that I change the number of characters in the substring to 8 because I know the device number is disk2s10. (8 characters) I know that's poor form and would like to look for the ' in the string to know when I'm at the end of the device name but I'm not that good a programmer. Can someone who is help me out, or at least point me to a good UNIX reference place.
Thanks

---
When I die, I want to go peacefully in my sleep, like my Grandfather, not screaming in terror like his passengers.



[ Reply to This | # ]