On Thu, 22 Jan 2004 17:06:58 -0800
"Larry Guest" <[EMAIL PROTECTED]> wrote:


> 
> But rsync does not know how to handle this string, I think when its
> passed to rsync its not text as I see it on the screen.  It cant make
> the dir and pukes.
> 
> I have seen a bunch of stuff out there for sprintf, etc  but no clear
> small little script to do this.
> 
> Thanks
> 


This will give you and answer like YYYYMMDDhhmmss for your directory name. Maybe watch 
line wrap

--------------------------------------------------------------

#!/usr/bin/perl

$dirname = dirname();
print "$dirname\n";

sub dirname{

my @t=localtime;
my $mon = $t[4]+1;my $yr = $t[5]+1900;
return (sprintf("%04d%02d%02d%02d%02d%02d",$t[5] +1900,$t[4]
+1,$t[3],$t[2],$t[1],$t[0]));

}





> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
> 
> 
> 


-- 
Owen


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to