[prev in list] [next in list] [prev in thread] [next in thread] 

List:       perl-win32-users
Subject:    Re: Carriage Return charachter in dos prompt
From:       "eyal edri" <my.tranquil () gmail ! com>
Date:       2006-06-08 18:17:47
Message-ID: 6c4efb760606081117o5721bda8w41ab795df383edb8 () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi All,

After testing multiple options to solve this annoying problem.
I contacted the sd_event.exe programmer and he told me the obvious...
just use the \n :) ... only with a little difference ==> add the '\' escape
sequence !!
so adding "\\n" or "\\t" did the job !
I was sure i tested it also, but apparently not.

thanks everyone for helping!

On 6/5/06, Timothy Johnson <tjohnson@zonelabs.com> wrote:
>
>
>
> -----Original Message-----
> From: perl-win32-users-bounces@listserv.ActiveState.com
> [mailto:perl-win32-users-bounces@listserv.ActiveState.com] On Behalf Of
> Sisyphus
> Sent: Saturday, June 03, 2006 7:45 PM
> To: eyal edri; perl-win32-users@listserv.ActiveState.com
> Subject: Re: Carriage Return charachter in dos prompt
>
>
> >> What I was unable to do is insert "carriage return" or "new line"
> char in
> >> those strings.
> >> i've tried \n or chr(13) but no good.
> >>
> >> example:
> >>
> >> system ("sd_event.exe -v -f DESCRIPTION= \"this is only a test for
> >>showing
> >> the cr problem. \n  here is where i would want to plant the cr char
> for
> >>e.g\"
> >> ");
> >>
>
> >I can find no such problem if I use perl.exe instead of sd_event.exe
> (which
> >I don't have). Does that mean that the behaviour of sd_event.exe is
> partly
> >responsible for the problem ?
>
> >D:\pscrpt>type try.pl
> >use warnings;
> >system('perl -e "print \"Hello\nWorld\""');
> >D:\pscrpt>perl try.pl
> >Hello
> >World
> >D:\pscrpt>
>
>
> The difference here is that you are not actually sending a newline
> character to the shell, you're just sending a backslash followed by an
> 'n' character, which the perl.exe invoked by system() later interprets
> to be a newline.  If the OP tried this they would end up with '\n' in
> the middle of their description, which is not what they want.
>
>


-- 
Eyal Edri | System & Security Engineer  | MindU@Avaya Communication.

[Attachment #5 (text/html)]

Hi All,<br><br>After testing multiple options to solve this annoying problem.<br>I \
contacted the sd_event.exe programmer and he told me the obvious... <br>just use the \
\n :) ... only with a little difference ==&gt; add the '\' escape sequence !!  <br>so \
adding &quot;<span style="font-weight: bold;">\\n&quot;</span> or &quot;\\t&quot; did \
the job !<br>I was sure i tested it also, but apparently not. <br><br>thanks everyone \
for helping!<br><br><div><span class="gmail_quote"> On 6/5/06, <b \
class="gmail_sendername">Timothy Johnson</b> &lt;<a \
href="mailto:tjohnson@zonelabs.com">tjohnson@zonelabs.com</a>&gt; \
wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, \
204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> <br><br>-----Original \
Message-----<br>From: <a \
href="mailto:perl-win32-users-bounces@listserv.ActiveState.com">perl-win32-users-bounces@listserv.ActiveState.com</a><br>[mailto:<a \
href="mailto:perl-win32-users-bounces@listserv.ActiveState.com"> \
perl-win32-users-bounces@listserv.ActiveState.com</a>] On Behalf \
Of<br>Sisyphus<br>Sent: Saturday, June 03, 2006 7:45 PM<br>To: eyal edri; <a \
href="mailto:perl-win32-users@listserv.ActiveState.com">perl-win32-users@listserv.ActiveState.com
 </a><br>Subject: Re: Carriage Return charachter in dos prompt<br><br><br>&gt;&gt; \
What I was unable to do is insert &quot;carriage return&quot; or &quot;new \
line&quot;<br>char in<br>&gt;&gt; those strings.<br>&gt;&gt; i've tried \n or chr(13) \
but no good. <br>&gt;&gt;<br>&gt;&gt; example:<br>&gt;&gt;<br>&gt;&gt; system \
(&quot;sd_event.exe -v -f DESCRIPTION= \&quot;this is only a test \
for<br>&gt;&gt;showing<br>&gt;&gt; the cr problem. \n&nbsp;&nbsp;here is where i \
would want to plant the cr char <br>for<br>&gt;&gt;e.g\&quot;<br>&gt;&gt; \
&quot;);<br>&gt;&gt;<br><br>&gt;I can find no such problem if I use perl.exe instead \
of sd_event.exe<br>(which<br>&gt;I don't have). Does that mean that the behaviour of \
sd_event.exe is <br>partly<br>&gt;responsible for the problem \
?<br><br>&gt;D:\pscrpt&gt;type try.pl<br>&gt;use warnings;<br>&gt;system('perl -e \
&quot;print \&quot;Hello\nWorld\&quot;&quot;');<br>&gt;D:\pscrpt&gt;perl \
try.pl<br>&gt;Hello<br> &gt;World<br>&gt;D:\pscrpt&gt;<br><br><br>The difference here \
is that you are not actually sending a newline<br>character to the shell, you're just \
sending a backslash followed by an<br>'n' character, which the perl.exe invoked by \
system() later interprets <br>to be a newline.&nbsp;&nbsp;If the OP tried this they \
would end up with '\n' in<br>the middle of their description, which is not what they \
want.<br><br></blockquote></div><br><br clear="all"><br>-- <br>Eyal Edri | System \
&amp; Security Engineer&nbsp;&nbsp;|  MindU@Avaya Communication.



_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic