Shirt Pocket Discussions  
    Home netTunes launchTunes SuperDuper! Buy Now Support Discussions About Shirt Pocket    

Go Back   Shirt Pocket Discussions > SuperDuper! > General
FAQ Community Calendar Today's Posts Search

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #10  
Old 05-11-2007, 04:12 AM
chris_johnsen chris_johnsen is offline
Registered User
 
Join Date: Jan 2007
Posts: 79
concise shell script examples

(The shell script code fragments below are untested since I don't have any AFP volumes, but people developing shell scripts might find the techniques useful.)

Here are some variations that I find a bit more natural for shell scripting:

Code:
mount | awk '/^afp_/ {print $3}' | xargs -n 1 umount -f
The -n 1 might not be needed on the xargs, but it results in the same umount invocations as the previous script (one per volume). Leaving the -n 1 off would put all the volumes into one umount invocation.

Of course, if you really want to always unmount all AFP volumes, something like this might work, too:

Code:
umount -Aft afp
That last variation is probably OK for AFP, but it is inappropriate for NFS since there are several NFS mediated mounts (automount) that are present on most systems (/Network, /Network/Servers, etc.). Changing afp to nfs in that last command would unmount these normal "volumes", too, which probably is not what the user really wants. Something like the first example with an extra pattern in the awk and/or an extra grep before the awk to select just the target volumes would probably be better for NFS volumes.

BTW, head -1 has the same result as sed -n '1p;1q', and is usually much easier to understand for those not versed in sed/ex/vi.
Reply With Quote
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Smart Update copying files that haven't been changed? salparadi General 3 11-05-2006 11:40 AM
Copying newer files across volumes. chip General 1 08-09-2006 08:07 PM
Long Hang While Copying BackerUpper General 4 06-12-2006 08:26 AM
SuperDuper! Erasing Audio Files? Emerson General 3 06-22-2005 01:41 PM
Smart update copying all files each time fabius General 15 05-29-2005 09:29 PM


All times are GMT -4. The time now is 01:00 AM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2026, vBulletin Solutions, Inc.