Hello all I have a script that reads in a control file
that list a dir. to
change to inside the control file I have
Dir: /cf/courseware
The part of the Perl script that I run to pull in that
info is
# Open the control file or log
my $control_file= "/home/qgriff/FTP.CTL";
unless ( open CTL, $control_file ) { $log->write(
"<Error> Could not open
$control_file: $!");
exit 1;
}
my ($site, $user, $password, $dir, $file );
my $stanza = 0;
while ( <CTL> ) {
chop;
#skip all comments
next if /^\s*#/;
#skip blank lines
next unless length;
#Check to see the control file has the site listed and
pass it to $site
if ( /^Site:\s+(\w+)/ ) {
$site = $1;
$stanza = 1;
($user, $password, $dir, $file ) = ('', '', '',
'' );
next;
}
if ($stanza) {
$user = $1 if /^User:\s+(\w+)/;
$password = $1 if /^Password:\s+(\w+)/;
<b>$dir = $1 if /^Dir:\s+(\W\w+\W\w+)/;</b>
$file = $1 if /^File:\s+(.+)$/;
if ( $user && $password && $dir && $file ) {
#Exit the loop
$stanza = 0;
#Submit the job for the real work
&submit_job($site, $user, $password, $dir,
$file);
}
}
}
This line is what I am having an issue with $dir = $1
if
/^Dir:\s+(\W\w+\W\w+)/;
That will match /your/path but it will not match /your
or /your/path/is. Is
there a better reg.exp. I can use that will match
anything with a / in and
everything after it so I can have /your our /your/path
or even a dir. ten
levels deep and it will still match it?
Thank you for your time.
Quenten Griffith
ext.4802
Unix System Admin.
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]