Reputation: 33
I have this alias in .bashrc:
alias clone='while ! rsync --rsh=ssh -avP --delete --stats --compress-level=9 $1/ $2:$3 | grep -q "Number of files transferred: 0" ; do echo -n .; sleep 1; done'
Got error when I do this:
clone /d/root/tmp [email protected] /temp
bash: syntax error near unexpected token `/d/root/tmp'
Everything works fine if I put this in a script file:
#!/bin/sh
while ! rsync --rsh=ssh -avP --delete --stats --compress-level=9 $1/ $2:$3 | grep -q "Number of files transferred: 0" ; do echo -n .; sleep 1; done
and execute the script file like so:
./clonescript /d/root/tmp [email protected] /temp
Any help is much appreciated.
Upvotes: 3
Views: 1481
Reputation: 798666
Aliases do not have positional arguments. create a function instead.
clone() {
while ...
...
}
Upvotes: 3