Author Topic: _PipeShellResult now appends two linefeed characters  (Read 2353 times)

Kohei

  • Senior Community Member
  • Posts: 192
  • Hero Points: 25
_PipeShellResult now appends two linefeed characters
« on: July 17, 2009, 02:02:02 pm »
Hi there,

I have a macro that concatenates two output strings from two shell command executions on Linux, to form a single line output, and I use _PipeShellResult call for this.  But when I upgraded to 14.0.2 I noticed that the command now append two linefeed characters (\n).  I'm on Linux (openSUSE 11.0), and I haven't tested on other machines to see if this is a system issue.  Do you guys see this on your end as well?

For now, I'm having to strip two characters off after each _PipeShellResult call, but that's a little inconvenient.

Here is the macro code I use:

Code: [Select]
_command void insert_date_today() name_info(',')
{
   int pin, pout, perr;
   _str datecmd = "/bin/date";
   _str cmd = datecmd :+ " +%Y-%m-%d";
   _str output = _PipeShellResult(cmd, 0, '');
   cmd = datecmd :+ " +(%A)";
   output = output :+ " " :+ _PipeShellResult(cmd, 0, '');
   _insert_text(output, false, "\n");
}

Thanks!