All pastes #793111 Raw Edit

i has a code

public shellscript v1 · immutable
·published 2007-11-21 23:14 UTC
rendered paste body
#!/usr/bin/perlchdir "/home/ftpfax/bernard" || die "can't chdir\n";while(<*.info>){	my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime;	$UNIQUE = sprintf("%i%02i%02i%02i%02i%02i-$$",$year+1900,$mon+1,$mday,$hour,$min,$sec);	($name) = split /\./;	unless(open FILE,"<$_")	{		print STDERR "Can't open file $_ ($!)\n";		next;	}	chomp($dest  = <FILE>);	$dest=~s/(\+)?[^\d]*/$1/g;	chomp($email = <FILE>);	chomp($comment = <FILE>);	close FILE;	next if($nodoublons{$dest}==1);	$nodoublons{$dest}=1;	print "$name > $dest\n";	open INFO,">/home/safefax/spool/local.pdf/$UNIQUE.tmp" or die "can't write in local.pdf ($!)";	print INFO "PSEUDO bernard\n";	print INFO "GFA ftpfax\n";	print INFO "DEST $dest\n";	print INFO "UNIQUE $UNIQUE\n";	print INFO "EMAILACK $email\n" if($email ne "");	print INFO "COMMENT $comment $name\n" if($comment ne "");	close INFO;	system "sed -i s/'%%EOF.*'/'%%EOF'/g $name.pdf" ;	system "cp $name.pdf /home/safefax/spool/local.pdf/$UNIQUE.pdf &&		mv $name.* inuse &&		chmod 660 /home/ftpfax/bernard/inuse/$name* &&		mv /home/safefax/spool/local.pdf/$UNIQUE.tmp /home/safefax/spool/local.pdf/$UNIQUE.info &&		sleep 4";}