notes/money/compare.pl
2023-04-15 19:29:07 +02:00

29 lines
546 B
Perl
Executable File

#!/usr/bin/perl
use strict;
use warnings;
my @subs = `tail -n +3 money/subs.md`;
chomp @subs;
my $today = `date +'%m.%d'`;
chop($today);
my $tommorow = `date -d '+1 day' +'%m.%d'`;
chop($tommorow);
my $fail = 0;
foreach my $sub (@subs) {
my @words = split /\|/, $sub;
my $date = $words[2];
$date =~ s/\./\\\./;
$date =~ s/\*/\./g;
$date =~ s/ //g;
my $regex = "m/$date/";
# print $regex;
if ($today =~ m/$date/ || $tommorow =~ m/$date/) {
print "$sub \n";
$fail = 1;
}
}
exit(1) if $fail;