[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 ==> add the '\' escape sequence !! <br>so \
adding "<span style="font-weight: bold;">\\n"</span> or "\\t" 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> <<a \
href="mailto:tjohnson@zonelabs.com">tjohnson@zonelabs.com</a>> \
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>>> \
What I was unable to do is insert "carriage return" or "new \
line"<br>char in<br>>> those strings.<br>>> i've tried \n or chr(13) \
but no good. <br>>><br>>> example:<br>>><br>>> system \
("sd_event.exe -v -f DESCRIPTION= \"this is only a test \
for<br>>>showing<br>>> the cr problem. \n here is where i \
would want to plant the cr char <br>for<br>>>e.g\"<br>>> \
");<br>>><br><br>>I can find no such problem if I use perl.exe instead \
of sd_event.exe<br>(which<br>>I don't have). Does that mean that the behaviour of \
sd_event.exe is <br>partly<br>>responsible for the problem \
?<br><br>>D:\pscrpt>type try.pl<br>>use warnings;<br>>system('perl -e \
"print \"Hello\nWorld\""');<br>>D:\pscrpt>perl \
try.pl<br>>Hello<br> >World<br>>D:\pscrpt><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. 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 \
& Security Engineer | 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