#!/usr/local/bin/perl -w use strict; my $config = $ARGV[0]; my $date = $ARGV[1]; my $who = $ARGV[2]; my $program = "/nfs/elmo/users/dd/bin/gen-cflowd-config"; my $matrix = "netmatrix"; my $path = "/nfs/elmo/users/dd/config/$date"; my %hash; my $host; my $key; my $script = "script-$date"; die "Usage: $0 \n" unless @ARGV == 3; open (CONFIG_FILE, $config) || die "Cannot open $config:$!\n"; while (my $line = ) { chomp $line; next if ($line =~ /^\#/); my ($router, $cache, $nta, $as, $Sample) = split (' ', $line); $host = (split "-", $nta)[0]; $host =~ tr/0-9//d; push @{$hash{$host}}, $router; } open (STDOUT, ">$script"); print <## #! /bin/sh if test ! -d /export/home/ssesar/flowstats/config/$date then mkdir /export/home/ssesar/flowstats/config/$date fi