Philippe Blain <levraiphilippeblain@xxxxxxxxx> writes: > Thanks for both answers. Felipe's solution does the trick, but Junio's does not; > it seems we do have to have a newline there. Curious. Are you sure you changed the second echo to printf and left the argument after '%s\n' unquoted, i.e. $variants and not "$variants"? > diff --git i/git-mergetool--lib.sh w/git-mergetool--lib.sh > index 2defef28cd..6f03975493 100644 > --- i/git-mergetool--lib.sh > +++ w/git-mergetool--lib.sh > @@ -46,7 +46,7 @@ show_tool_names () { > while read scriptname > do > setup_tool "$scriptname" 2>/dev/null > - variants="$variants$(list_tool_variants)\n" > + variants="$(echo "$variants" && list_tool_variants)" Gee, echoing the variable double-quoted inside $()? That's as ugly as a command substitution construct can go X-<. > done > variants="$(echo "$variants" | sort | uniq)"