#!/bin/bash a=$1 cp_a=$a b=$2 cp_b=$b while [ $b -ne 0 ]; do temp=$b b=$((a % b)) a=$temp done c=$((cp_a * cp_b)) d=$((c / a)) echo $d