linux - Script is only reading numbers with one digit -


so i'm trying script done email me when system has high load avoid crashing . far i'm observing works until value reaches 9.99 after grows past 10 script gives index error when running , doesn't work anymore . maximum value load can reach 16.

cat /proc/loadavg | awk '{print $1}' | while read output; la=$(echo $output) alert=7 if [[ "$la" > "$alert" ]] subject="high load - >$la!!!" email="@mail.com" echo "la $la!!!!"> $emailmessage #send email using /bin/mail  mail -s "$subject" "$email"< $emailmessage fi done 


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -