script perl with sed command

Giorgos Keramidas keramida at ceid.upatras.gr
Sun Apr 8 17:51:02 UTC 2007


On 2007-04-08 09:28, Garrett Cooper <youshi10 at u.washington.edu> wrote:
> Olivier Regnier wrote:
> The file has to exist that you're trying to modify, otherwise it'll give
> up :). Permissions issue?
> 
> Better to do that section may be:
> 
>      my $tmpsupfile;
>      my $supfile = "/etc/standard-supfile";
>      my $newhost = "cvsup.fr.freebsd.org";
> 
>      if (!defined($supfile) || !defined($newhost)) {
>          return undef;
>      }
> 
>      $tmpsupfile = new File::Temp();
>      die "$!" unless(defined($tmpsupfile);
>      open(SUP, "$supfile") or die "$!";

Ah, much better, thanks :)



More information about the freebsd-questions mailing list