#!/bin/csh -f # undropbox # ------------------------------------------------------------------------- # Clear the Mac OS X Dropbox attributes that get left behind when I copy # or move a file out of Dropbox # ------------------------------------------------------------------------- # Revision History: # $Log$ # ------------------------------------------------------------------------- # Collect command line options set option_prefix_string = "" while ($#argv > 0) if ("$1" == "-h" || "$1" == "--help") then echo "Deletes the Mac OS X Dropbox attributes." echo "Usage: $0:t [options] files..." echo "Options:" echo " -h = Show this help text" echo " --help = Show this help text" echo " -p prefix_string = Prefix each output line with prefix_string" echo "Examples:" echo " $0:t -q *.jpg" echo " $0:t -q -p 'Un-Dropboxed: ' *.pdf " exit 1 else if ("$1" == "-p") then shift set option_prefix_string = "$1" shift else if ("-" == "`echo $1:q | cut -c 1`") then echo "Error: Invalid option: $1:q" $0 --help exit 1 else # Not a recognized option. Assume it's the first argument break endif end # At least 1 argument required if ($#argv < 1) then echo "Error: No filename specified." $0 -h exit 1 endif xattr_delete -v -p "$option_prefix_string" com.dropbox.attributes $*:q xattr_delete -v -p "$option_prefix_string" com.dropbox.attrs $*:q xattr_delete -v -p "$option_prefix_string" com.dropbox.internal $*:q