2 # save the output of ANY command to a file
4 # Copyright (c) 2002 Dirk Koopman G1TLH
9 my ($self, $line) = @_;
10 return (1, $self->msg('e5')) if $self->priv < 9 || $self->remotecmd;
12 my ($date_req, $time_req);
14 if ($line =~ /-d/) { # add a date to the end of the filename
15 $line =~ s/\s*-d\s*//;
18 if ($line =~ /-t/) { # add a time to the end of the filename
19 $line =~ s/\s*-t\s*//;
22 if ($line =~ /-a/) { # append to the file
23 $line =~ s/\s*-a\s*//;
27 my ($fn, $rest) = split /\s+/, $line, 2;
28 $fn .= '_' . cldate if $date_req;
29 $fn .= '_' . ztime if $time_req;
33 if ($rest =~ /^\s*\"/) {
34 @cmd = split /\s*\"[\s,]?\"?/, $rest;
38 open OF, "$app_req$fn" or return (1, $self->msg('e30', $fn));
40 print OF map {"$_\n"} $self->run_cmd($_);
43 return (1, $self->msg('ok'));