if [ ! `uptime | grep day` ]
then
chk_op[0]="WARNING...reboot within the last 24hrs, restarted at `who -r | awk '{print $4$5"@"$6}'`" ;
else
if [ `uptime | awk '{print$3}'` -ge 100 ] ;
then
last_reboot1=`who -b | awk '{print $4" "$5" "$6}'`
last_reboot2='..OK..'`uptime | awk '{print$3" "$4}'`
chk_op[0]="last rebooted on ${last_reboot1} ${last_reboot2}"
fi
fi
The following is received when executing the code:
ksh: up: unknown test operator
The backticks have been deprecated in favor of $() for command substitution because $() can easily nest within itself as in $(echo foo$(echo bar)). There are also minor differences such as how backslashes are parsed in the backticks version.
Eks echo "hello1-`echo hello2-\`echo hello3-\\\`echo hello4\\\`\``"
vs echo "hello1-$(echo hello2-$(echo hello3-$(echo hello4)))"