Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Why this doesn't work?



On Mar 12, 11:14am, DervishD wrote:
} Subject: Why this doesn't work?

As long as I'm passing out netiquette lessons, I might as well say
that it would be nice if the word "this" in that Subject had been
replaced by a slightly more descriptive phrase.

}     $ eval printf -- "Hello\\n"
}     Hello$

If this is really what you're seeing, then something is indeed wrong.
What you should see is "Hellon", not "Hello".

}     $ eval printf -- "Hello\\\n"
}     Hello<newline>
} 
}     I mean, no newline character is output when using just two
} backslashes, and I don't understand that.

Remember that when you use "eval" the command line is actually parsed
twice.  So
	eval printf -- "Hello\\n"
is equivalent to
	printf -- Hello\n

The first parse removes the quotes and one of the backslashes, and the
second parse removes the remaining backslash.



Messages sorted by: Reverse Date, Date, Thread, Author