From 7fe27fc6932d37c624a2668d8c904ed8281e01ba Mon Sep 17 00:00:00 2001 From: Justin Lecher Date: Tue, 28 Sep 2021 20:59:01 +0100 Subject: [PATCH] Use posix compliant tail syntax homebrew allows using gnu coreutils on MacOS. Therefore we should comply with posix standards ```bash $ mas help | tail +3 tail: cannot open '+3' for reading: No such file or directory $ type tail tail is /usr/local/opt/coreutils/libexec/gnubin/tail ``` Switching to posix compliant `-n` syntax is compatible with UNIX and GNU tooling. ```bash $ mas help | /usr/bin/tail -n +3 | wc -l 18 $ mas help | tail -n +3 | wc -l 18 ``` --- contrib/completion/mas-completion.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/completion/mas-completion.bash b/contrib/completion/mas-completion.bash index d431b29..31d9a09 100644 --- a/contrib/completion/mas-completion.bash +++ b/contrib/completion/mas-completion.bash @@ -9,7 +9,7 @@ _mas() { _get_comp_words_by_ref cur prev words cword fi if [[ $cword -eq 1 ]]; then - COMPREPLY=($(compgen -W "$(mas help | tail +3 | awk '{print $1}')" -- "$cur")) + COMPREPLY=($(compgen -W "$(mas help | tail -n +3 | awk '{print $1}')" -- "$cur")) return 0 fi }