--- sms.alert 2003/02/06 12:12:36 1.4 +++ sms.alert 2003/02/14 14:54:45 1.6 @@ -38,7 +38,7 @@ use strict; my %opt; use Getopt::Std; -getopts ("S:s:g:h:t:l:uf"); +getopts ("S:s:g:h:t:l:uf", \%opt); # read addressbook my %name2phone; @@ -71,7 +71,9 @@ my $sms = "From: mon\n"; $sms .= "Flash: yes\n" if $opt{f}; -$sms .= "\n$ALERT $opt{g}/$opt{s} $summary ($wday $mon $day $tm)\n"; +$sms .= "\n$ALERT"; +$sms .= " $opt{g}/$opt{s}" if ($opt{g} && $opt{s}); +$sms .= " $summary ($wday $mon $day $tm)\n"; # add next alter time $sms .= "Secs until next alert: $opt{l}\n" if $opt{l}; # add rest of text