function trash --description 'Sends files and directories to the trash'
if test (uname -s) != "Darwin"
echo "Error: this command is for OSX only"
return 1
end
if test (count $argv) -eq 0
echo "usage: trash <file> [<files>...]"
return
end
for f in $argv
if test -e $f
set filedir (dirname $f)
set filename (basename $f)
pushd $filedir
set osascr 'tell app "Finder" to move the
POSIX file "'$PWD'/'$filename'" to trash'
osascript -e $osascr
popd
else
echo "Error:" $f "does not exist"
end
end
end
--
Steven Scott
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________
Fish-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fish-users