You are not logged in.
I've set up an alias in my bashrc to simplify my rclone commands for google drive. If I type the full command directly to the terminal, it runs just as expected. When I use the alias, however, I get an error: "Command sync needs 2 arguments maximum"
The relevant bit of my .bashrc looks looks like:
alias gdrive-up='rclone sync ~/Gdrive gdrive: --exclude '.*' -vu'
alias gdrive-dn='rclone sync gdrive: ~/Gdrive --exclude '.*' -vu'I've used . ~/.bashrc and whatnot. I've even messed with adding and removing arguments, just to test. I'm really at a loss, here.
Thanks
Edit: Even if I copy the full command straight from .bashrc I get the error.
Last edited by SpaceOttersea (2018-02-01 08:55:41)
Offline
The first step to troubleshooting issues with aliases is... displaying them!
alias gdrive-up gdrive-dnAnd there you should already see where it goes wrong.
You are trying to nest single quotes within single quotes, which is not possible. Try quoting it as ".*" instead.
--edit: I also hope you now also understand why it's giving you that "too many arguments" error?
Last edited by ayekat (2018-02-01 10:06:34)
Offline
Or rather remove the outer quotes, since the ~ will also not be correctly expanded otherwise.
Offline
No, the outer quotes are required for alias definitions. See
alias a=b c
alias aAlso, the string is interpreted—and thus things like ~ and wildcards (e.g. .*) are resolved—by the shell the moment the alias is used, so that's not an issue. See:
alias a='echo ~'
aOffline
Ah true, sorry I brainfarted for a sec there.
Offline
Oh, yep. Adding double quotes solved the issue. I'm new to scripting and all, but that does make sense. Thanks for the replies!
Offline