#!/bin/bash if [ $# -ne 2 ]; then echo "error, pls whrite 2 arguments" exit 1 fi a=$1 b=$2 while [ $b -ne 0 ]; do ostatok=$((a % b)) a=$b b=$ostatok done echo $a