The behaviour and output of rsync, and indeed any command, may depend on the environment - for instance the LANG and locale variable - and sometimes also on whether the output goes directly to the console or not (see isatty(3)).<br>
Some C library functions behave differently depending on the locale, which can be a bit surprising:<br><br><div style="margin-left:40px">$ /usr/bin/printf "%f\n" "123.45" # In the da_DK locale, decimal point is ","<br>
123,450000<br><br>$ LANG=C /usr/bin/printf "%f\n" "123.45"<br>123.450000<br><br>$ type printf<br>printf is a shell builtin<br>$ printf "%f\n" "123.45" # Uses the locale (da_DK) for parsing the number<br>
bash: printf: 123.45: invalid number<br>0,000000<br><br>$ LANG=C printf "%f\n" "123.45" # This ought to work, but doesn't<br>bash: printf: 123.45: invalid number<br>0,000000<br>$ export LANG=C ; printf "%f\n" "123.45" # This works<br>
123.450000<br><br></div>Sorting strings is another thing that may behave differently depending on the locale.<br><br>
<div class="gmail_quote">2012/5/20 eigenfunction <span dir="ltr"><<a href="mailto:emeka_1978@yahoo.com" target="_blank">emeka_1978@yahoo.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I am using rsync through os:cmd and rely on the console ouput from the<br>
rsync command to decide whether or not the operation was successulf or<br>
not, specially in the case where a file is missing on the remote end.<br>
What i found out is that the return value of os:cmd does not always<br>
equal the output of the rsync command run in the console.<br>
Therefore my question: Is it the normal behaviour?<br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div><br>