Can someone please let me know if the following commands should work as I am not sure and am getting error?
Just to let you know that I am using this in one of my nagios scripts:
## GET SWAP Warning and Critical values from the Machine
temp=$(swapon -s | tail -n 1 | awk '{print $3}' )
SWAP_WARN=$(echo '$(temp)*.20' | bc)
SWAP_CRIT=$(echo '$(temp)*.40' | bc)