feature request

Frederik Eaton frederik at a5.repetae.net
Sun Mar 6 01:54:28 GMT 2005


> > In which case, do you have boilerplate shell code which parses rsync
> > command lines (or is there such code included in the distribution for
> > easy update in case the argument syntax changes)? It seems non-trivial
> > to me.
> 
> It's not needed.  No option name ends in "/", so the function can scan
> all the args without understanding them.
> 
> If you use zsh or bash, you could put something like this into your rc:
> 
> function rsync {
>     local cmd=''
>     for arg in "$@"; do
> 	case "$arg" in
> 	*\'*)
> 	    echo "Args may not contain embedded single quotes!"
> 	    return 1
> 	    ;;
> 	*/)
> 	    arg=${arg/%\//}
> 	    ;;
> 	esac
> 	cmd="$cmd '$arg'"
>     done
>     eval "/usr/bin/rsync $cmd"
> }
> 
> That's a quick hack, though -- the "eval" idiom can probably be done
> better.

Thanks, I guess that works. It breaks some functionality of the
--include and --exclude options:

   o      if the pattern ends with a / then it will only  match  a  direc-
          tory, not a file, link, or device.

but I doubt I'll ever use that.

However, you haven't given your reasons for not wanting to include the
proposed option. I'm curious.

Frederik

-- 
http://ofb.net/~frederik/


More information about the rsync mailing list