From 1444d5cc01d139bfebc8c139c0dcbc66bdd0ee45 Mon Sep 17 00:00:00 2001 From: mischa Date: Thu, 9 May 2024 20:33:27 +0200 Subject: [PATCH] if vmXX.txt is passed to notify.pl strip .txt --- notify.pl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/notify.pl b/notify.pl index faf6136..6f71afa 100755 --- a/notify.pl +++ b/notify.pl @@ -34,7 +34,11 @@ my $function = $ARGV[0] || "empty"; my $function_variable = $ARGV[1] || "empty"; my $message = $ARGV[2] || "empty"; -$function_variable = substr $function_variable, 0, -4 if ($function_variable =~ m/.txt/); +if ($function_variable =~ m/.txt/) { + $function_variable = substr $function_variable, 0, -4; + $function_variable = substr $function_variable, 4; + say $function_variable; +} # define the prices for the different components of the VM my $base_price = '67';