2 ms·
The "dynamic" example: complete -o default -W "`echo $(cat /path/to/file | grep 'lines i want')`" \ [command] is easier written as complete -o default -W
by ivanstojic 17y ago
The "dynamic" example:
complete -o default -W "`echo $(cat /path/to/file | grep 'lines i want')`" \
[command]
is easier written as
complete -o default -W "`echo $(grep 'lines i want' /path/to/file)`" \
[command]
- lallysingh 17y agopipe that grep through | tr '\n' ' ' and you don't need the echo.
- mustpax 17y agoThat makes a lot of sense, thanks for pointing these out. I'm updating the article to reflect these corrections.
- lallysingh 17y agoBtw, your updated version has an unnecessary ` lying near the end.
- mustpax 17y agoCorrected again :) Thanks.