printf function in c doesn\'t always print the output on screen. For example if you forget to put \\n at the end of string you are printfing you sometimes don\'t get the o/p
There is another special case I just encountered:
My variables are:
line="-24 hours"
line2="24 hours"
and try
printf $line
printf $line2
Neither will work. The second one drops the word "hours" and the first one mistakes -24 as a flag.
Therefore, whenever I use printf I will remove all the dangerous characters if possible, by using
sed -r "s/[/\ #;&~]/_/g"
I wish printf's codes can be improved by the developer.
Take care