HP3000-L Archives

November 2000, Week 2

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Ken Hirsch <[log in to unmask]>
Reply To:
Ken Hirsch <[log in to unmask]>
Date:
Tue, 14 Nov 2000 12:06:07 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (29 lines)
I believe that Steve Dirickson's script will have problems if the directory
name or e-mail address has a space in it.

The best thing to do is download Perl
(http://www.activestate.com/Products/ActivePerl/Download.html) and use it.
Here's a Perl program to do what you want.  As written, if there is an error
it will continue with the next line.

#!perl -w
use strict;

my @a;

while (<>) {
  chomp;
  @a = split /\t/;   # Here tab (\t) is the separator character

  if (not chdir($a[0])) {
    print STDERR "Cannot chdir to $a[0]: $!\n";
    next;
  }

  if (not open OUT, ">forward.ima") {
    print STDERR "Cannot open forward.ima: $!\n";
    next;
  }
  print OUT "$a[1]\n";
}

ATOM RSS1 RSS2