```shell
#!/bin/bash
find_smallest_digit() {
# Convert the number to a string
number=$1
# Initialize the smallest digit with the first digit of the number
smallest_digit=${number:0:1}
# Iterate over the remaining digits of the number
for (( i=1; i<${#number}; i++ )) {
# Get the current digit
current_digit=${number:i:1}
# Update the smallest digit if the current digit is smaller
if [ $current_digit -lt $smallest_digit ]; then
smallest_digit=$current_digit
fi
}
# Return the smallest digit
echo $smallest_digit
}
read -p "Enter a number: " number
smallest_digit=$(find_smallest_digit $number)
echo "The smallest digit of $number is $smallest_digit."
```