I have this bash script:
while IFS='"' read -r a ip c
do
echo "ip: $ip"
whois "$ip" | grep netname
done < <(head -10 file.log)
How can I sort the file.log file (e.g. with sort -n -r) before the first ten lines are taken and handed over to the while-loop?
head -10 file.log | sort -nrsort -nr file.log | head -10