newbie - messy output from system command? 
Author Message
 newbie - messy output from system command?

Hi,

My script is below, along with the output. I simply need to be able to
format the output so line breaks are used. Simple I am sure but even
scouring through this group has not helped.

Any code samples appreciated,
Thanks.

[code]
#! /usr/bin/perl

use CGI qw(param);


$ENV{'JAVA_HOME'} = 'd:\jdk1.2.2';

$vss_label = param("vss_label");
$next_label = param("next_label");
$release_identity = param("release_identity");

"-Dnum_files_vss_should_fetch=$no_files_to_get");

print "Content-type: text/html\n\n";
print "<html><body bgcolor='#FFFFFF' text='#000000'>";
print "<font face='Verdana, Arial, Helvetica, sans-serif' size='1'
color='#999999'>";
print "<h1>[start]<BR>";
print "</h1>\n";
print "<BR><BR>";
print "<font face='Verdana, Arial, Helvetica, sans-serif' size='3'
color='#000000'>";


print "<font face='Verdana, Arial, Helvetica, sans-serif' size='1'
color='#999999'>";
print "<html><body><h1>[end]";
print "</h1></body></html>\n";

[output]
[start]
Buildfile: d:\build_folder\ux_dev02\ant_buildfiles\dev2_to_staging2.xml
A nonfatal internal JIT (3.10.107(x)) error 'Relocation error: NULL
relocation target' has occurred in :
'org/apache/crimson/parser/Parser2.maybeComment (Z)Z': Interpreting
method. Please report this error in detail to
http://www.*-*-*.com/ : start_logging:
[echo] Logging started initialise: clean_vss_filearea: [delete]
Deleting directory D:\Build_Folder\ux_dev02\release_files [mkdir]
Created dir: D:\Build_Folder\ux_dev02\release_files mail_notice:
[mail] Sending email fetch_labelled_VSSfiles: [exec] SSGet v1, 0, 0, 0
[exec] UK GTSC Visual C++ Client Team, Microsoft UK Limited [exec]
[exec] abnormal program termination [exec] Copyright (c) 2001
Microsoft Corporation, All Rights Reserved [exec] [exec] Result: 3
get_VSS_files: clean_release: delete_specific_files: integrity_count:
[exec] Result: 255 [echo] Files fetched from VSS : The system cannot
find the path specified. [echo] Files should be fetched: 45
WarnUserVSSBad: BUILD FAILED
D:\build_folder\ux_dev02\ant_buildfiles\dev2_to_staging2.xml:126:
SOURCESAFE ERROR - VSSGET has not fetched the correct number of files
as specified in the 'num_files_vss_should_fetch' variable within this
script. Check the script variable contains the correct entry. Total
time: 2 seconds 0
[end]



Sun, 18 Jul 2004 23:26:11 GMT  
 newbie - messy output from system command?


Quote:
> Hi,

> My script is below, along with the output. I simply need to be able to
> format the output so line breaks are used. Simple I am sure but even
> scouring through this group has not helped.

> Any code samples appreciated,
> Thanks.

> [code]
> #! /usr/bin/perl

> use CGI qw(param);


> $ENV{'JAVA_HOME'} = 'd:\jdk1.2.2';

> $vss_label = param("vss_label");
> $next_label = param("next_label");
> $release_identity = param("release_identity");
> $no_files_to_get = param("no_files_to_get");

> "-Dnum_files_vss_should_fetch=$no_files_to_get");

> print "Content-type: text/html\n\n";
> print "<html><body bgcolor='#FFFFFF' text='#000000'>";
> print "<font face='Verdana, Arial, Helvetica, sans-serif' size='1'
> color='#999999'>";
> print "<h1>[start]<BR>";
> print "</h1>\n";
> print "<BR><BR>";
> print "<font face='Verdana, Arial, Helvetica, sans-serif' size='3'
> color='#000000'>";

I think the 'messy' output is because <CR/LF> (if any) is ignored in html
So here try :-

    print "<PRE>";

Quote:

> system("ant", qw(-f

d:\build_folder\ux_dev02\ant_buildfiles\dev2_to_staging2.xml),

And here try :-

    print "</PRE>";

Quote:
> print "<font face='Verdana, Arial, Helvetica, sans-serif' size='1'
> color='#999999'>";
> print "<html><body><h1>[end]";
> print "</h1></body></html>\n";

[snip messy output example]


Mon, 19 Jul 2004 00:45:37 GMT  
 newbie - messy output from system command?
Thats great, worked as required. Thanks.


Mon, 19 Jul 2004 18:20:49 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. IPC + fork()s + messy output

2. newline problem with messy output - v simple problem

3. Read output of a system command

4. Capturing System Command Output with Perl on Windows/Apache

5. capturing output of executed system command

6. Capturing output of a system command

7. system command output ?

8. Trapping the output of the System command into a variable

9. Screen output from system command.

10. Synchronizing output from system command?

11. Capture output from system command?

12. capturing system command output

 

 
Powered by phpBB® Forum Software