Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Tinlad

macrumors member
Original poster
May 1, 2006
60
0
Nottingham, UK
Hi, I've got a bit of a mental block.

I'm writing a script for Salling Clicker using AppleScript that will allow me to mount/unmount the partitions on my external drive remotely.

At the moment I have the name of the partition I want to unmount, "Mac Files", but I need the identifier, "disk1s1", which is the last six characters of the output from a shell script it runs:

1: Apple_HFS Mac Files 162.9 GB disk1s1

How can I use either AppleScript or some bash command to get those last six characters only? Using awk '{print $6}' to print only the sixth field only works if the partition doesn't have a space in the name.

I hope that makes sense. Thanks in advance.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.