Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: view onto command pipeline?



On Wed, Jul 20, 2022 at 07:23:46AM -0400, Anthony Heading wrote:
>         local opts=()
>         if [[ -o interactive && ( -t 1 || -n $pager ) ]]
>         then
>                 opts=(-c color.ui=always)
>         fi
>         command git $opts $@

For proper handling of whitecpace in options and arguments:

  command git "${opts[@]}" "$@"

Otherwise, if you have, say, files "a", "b" and "a b",

  $ git commit "a b"

Would commit a and b but not "a b" if the $@ is not quoted.  As a
rule of thumb, _never_ use unquoted variables in shell scripts.

Ciao

Dominik ^_^  ^_^

--

Dominik Vogt




Messages sorted by: Reverse Date, Date, Thread, Author