Re: [PATCH] mergetool: Replace use of "echo -n" with printf(3) to be more portable
- From
- Matthias Lederhofer <matled@gmx.net>
- Date
- Mar 29, 2007, 15:57 UTC
- Message-ID
- <20070329155741.GA18413@moooo.ath.cx>
- In-Reply-To
- <11751830651770-git-send-email-tytso@mit.edu>
The subject should probably refer to printf(1) instead of printf(3).
Theodore Ts'o <tytso@mit.edu> wrote:
> - echo -n "'$path' was deleted" > + printf "'$path' was deleted"
Here is one space too much after printf.
> - echo -n "'$path' is a symlink containing '" > + printf "'$path' is a symlink containing '"
You should use printf "'%s' [..]" "$path" as you do in some other places (in case $path contains conversion specifiers).
> - echo -n "Hit return to start merge resolution tool ($merge_tool): " > + printf "Hit return to start merge resolution tool ($merge_tool): "
Here it is much more unlikely that $merge_tool contains a conversion specifier but anyway I'd prefer to use %s.