Andrew Chung wrote:
> Thanks Stephen,
>
> I wonder what the EOF syntax is for a normal shell script
> in bourne shell or csh?
>
> Does anybody know?
>
>From UNIX in a Nutshell: "Read" ... "The return status is 0 unless EOF is
reached". This seems to only work on stdin, but your can pipe/redirect from the
command line.
Or, in Perl use the following script. Give it your filenames as a command
argument and it will put the fixed files in a subdirectory called "fixed". I hope
I got all the logic on this right - it seams to work on your test lines.
Jeremy Wadsack
OutQuest Magazine
a Wadsack-Allen publication
#!usr/bin/perl
# Munge each file
foreach $filename (@ARGV ) {
mkdir( "fixed", umask );
$outFilename = "fixed/$filename";
# -- Open input and output files
open( INPUT, $filename );
open( OUTPUT, ">$outFilename" );
# -- Find and update each bad time stamp
foreach $contents (<INPUT>) {
$contents =~ s/(\d\d\d\d\:)(\d\d)(\:\d)/$1 . $2%24 . $3/e;
print OUTPUT $contents;
} # end foreach
# -- Close input and output files
close( OUTPUT );
close( INPUT );
} # end foreach
--------------------------------------------------------------------
This is the analog-help mailing list. To unsubscribe from this
mailing list, send mail to [EMAIL PROTECTED]
with "unsubscribe analog-help" in the main BODY OF THE MESSAGE.
--------------------------------------------------------------------