On Sun, Jan 3, 2021, at 14:16, Sergey Matveev wrote:
> "all" target is useful only as a default rule that is run by many
> implementations by default and you have just to type "redo" to build the
> program.
Yes, agreed.
> Everything looks good. But I am just curious: why do you use
>
> printf 'recompiling %s\n' $2.c >&2
> printf 'relinking\n' >&2
>
> instead of?:
>
> echo recompiling $2.c >&2
> echo relinking >&2
I am in the habit of using printf rather than echo because of the drawbacks of echo as explained in
https://unix.stackexchange.com/questions/65803/why-is-printf-better-than-echo. For
echo relinking
specifically, it doesn't matter. For
echo recompiling $2.c
specifically, if $2 contains any characters that echo might interpret, it might come out wrong.
> In my opinion the later is easier to read and understand.
Yes I agree that the echo is a bit simpler and easier than the printf, but it
has disadvantages.
> And personally I am pretty against that kind of messages.
They are educational messages for me because I am learning.
Thank you for your feedback. I am grateful.
Received on Sun Jan 03 2021 - 20:38:30 CET