#!/bin/bash a=$1 b=$2 x=$a y=$b while [ $y -ne 0 ]; do rem=$((x % y)) x=$y y=$rem done g=$x l=$(( (a * b) / g )) echo $l