diff --git a/Administrating-wildduck-via-command-line.md b/Administrating-wildduck-via-command-line.md index a1bb5d7..ac83f41 100644 --- a/Administrating-wildduck-via-command-line.md +++ b/Administrating-wildduck-via-command-line.md @@ -34,6 +34,26 @@ $ functionname myargument1 my2 If you save it to `~/.bashrc`, then you can call it as any `alias` defined there. +### Better to source our file in `.bashrc` rather then defining there + +It is better to have a separate file for wildduck related commands, and +`source` it in `bashrc` file, then polluting too much it. + +So we create a file named `~/.wildduck.commands`, and `source` it. +Paste this at the end of `~/.bashrc` file: + +``` +# include .wildduck.commands if it exists +if [ -f $HOME/.wildduck.commands ]; then + . $HOME/.wildduck.commands + echo ".wildduck.commands file has been sourced +fi +``` + +Please not, that `. file` is the same as `source file`. But dot itself is +POSIX compatible, while `source` is bash builtin (and some other shells too), +but bash itself [does not make a distinction between dot and source](https://stackoverflow.com/a/20094373). + # REST api In the below examples, we are taking or commands from [wildduck API](https://api.wildduck.email/).