There are (at least) two problems:
- the output of
ls
contains slashes (/
), which clash with the syntax of thecomplete
command. To bypass, use a different separator, e.g.@
~
is not replaced when appearing inside single quotes. Use$HOME
instead.- (just guessing) if by any chance you have
ls
defined to be some alias (very common), inside yourcomplete
you'd want the unaliasedls
. So use\ls
.
We get:
complete note 'p@1@`\ls $HOME/notes/notes_db`@'