From cf304b85d436b8bf2a309cbd473548bbf5641f12 Mon Sep 17 00:00:00 2001 From: eslopfer Date: Mon, 9 Jan 2023 07:29:20 +0000 Subject: [PATCH] fix(division): remove wrong file pushed --- sh/tests/student/division.sh | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 sh/tests/student/division.sh diff --git a/sh/tests/student/division.sh b/sh/tests/student/division.sh deleted file mode 100644 index 8f5b62ef9..000000000 --- a/sh/tests/student/division.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env bash - -# Check if two arguments were provided -if [ $# -ne 2 ] -then - echo "Error: two numbers must be provided" - exit 1 -fi - -# Check if the arguments are numeric -if ! [[ $1 =~ ^-?[0-9]*\.?[0-9]+$ ]] || ! [[ $2 =~ ^-?[0-9]*\.?[0-9]+$ ]] -then - echo "Error: both arguments must be numeric" - exit 1 -fi - -# Check if the second argument is not 0 -if [ $(echo "$2 == 0" | bc) -eq 1 ] -then - echo "Error: division by zero is not allowed" - exit 1 -fi - -# Divide the first argument by the second using bc -result=$(echo "$1 / $2" | bc ) - -# Output the result -echo $result