Re: Help with printf

2008-06-11 Thread Shachar Shemesh
Dan Bar Dov wrote: I'm not using it from shell, that was just an example. I need to read format strings from file and use them to print stuff like error reports (the error includes only parameters, and the format string comes from a file. Please bear in mind that allowing a party to write

Re: Help with printf

2008-06-11 Thread Nadav Har'El
On Wed, Jun 11, 2008, Dan Bar Dov wrote about "Re: Help with printf": > > There are several ways you can fix this problem. The most obvious one is > > to parse the string in the C code, and do the replacement of \n into a > > Is there a library function that does t

Re: Help with printf

2008-06-11 Thread Dan Bar Dov
On Wed, Jun 11, 2008 at 10:30 AM, Nadav Har'El <[EMAIL PROTECTED]> wrote: > On Wed, Jun 11, 2008, Dan Bar Dov wrote about "Help with printf": > >... > > But if I put the format in a variable (as opposed to a string literal), I > > find that > > escape processing does not occur. > >... > > and runn

Re: Help with printf

2008-06-11 Thread Yedidyah Bar-David
On Wed, Jun 11, 2008 at 10:11:07AM +0300, Dan Bar Dov wrote: > Usually we use printf with a string literal for the format, > e.g. > printf("%d flowers\n",count); > > But if I put the format in a variable (as opposed to a string literal), I > find that > escape processing does not occur. > > so us

Re: Help with printf

2008-06-11 Thread Nadav Har'El
On Wed, Jun 11, 2008, Dan Bar Dov wrote about "Help with printf": >... > But if I put the format in a variable (as opposed to a string literal), I > find that > escape processing does not occur. >... > and running (# is the prompt) > # ./test "%s flowers\n" 7 > > give the output > 7 flowers\n# Wh