On 08/18/2011 07:57 PM, Eric Blake wrote:
On 08/18/2011 08:53 AM, Roman Rakus wrote:
On 08/18/2011 04:38 PM, Sam Steingold wrote:
how do I write a function that would print the same as
$ \ls | cat
f3(){ printf "%s\n" "$@"; }
"\n" looks funny in shell; even though POSIX requires that "\n" does
not treat the \ as an escape but as a literal character,
stylistically, I prefer writing "\\n" or '\n' to make it clear that I
intended a literal backslash.
Interesting. I would expect that "\\n" in printf will print out `\n'.
Good to know.
RR