I'm new in shell scripting, so please help me with my problem.
How can I do a bash script's for loop to find the smallest number?
If I have an example: 1 4 6 23 5 7 100 2
Answer: 1
#!/bin/bash
firstloop=true
for x in 4 6 23 5 7 1 100 2; do
if $firstloop -or [ $x -lt $y ]; then
firstloop=false
y=$x
fi
done
echo "Lowest Number is $y"