#!/bin/bash inputt=$1 if [[ $3 == [a-z] ]]; then echo "The third argument is a character" var=`cat /home/turhana/Desktop/input.txt` num1=$(grep -o "$2" < "$1" | wc -l) num2=$(grep -o "$3" < "$1" | wc -l) echo $(($num1+$num2)) elif [[ $3 == 1 ]]; then echo "The third argument is an integer and equals to 1" num1=$(grep -o "["$2"-z]" < "$1" | wc -l) echo $num1 elif [[ $3 > 1 ]]; then echo "The third argument is an integer and greater than 1" argument="$2" result="" for ((i = 0; i<$3; i++)) do result="$result$argument" done answer=$(grep -o "$result" < "$1" | wc -l) echo $answer fi