I've been learning shell scripting since yesterday. I want to make a script that returns the minimum number from all the numbers in a text file. This is what I have so far:
#!/bin/bash
file="example.txt"
min=cat $file|head -1
for i in $(cat $file); do
if [[ $min -gt $i ]]; then
min=$i
fi
done
echo $min
I keep getting an error in line 3 that says "example.txt: command not found".