(standard_in) 1: illegal character: $
- #mem_free=
free -h |grep Mem |awk '{print $4}'|tr -d "a-zA-Z"|tr -d $'\r'
#Grab the total free memory - #mem_free_test=
echo 'scale=0;($mem_free * 95 / 100)'|bc
#Value 95%
centos下执行第二行出错:(standard_in) 1: illegal character: $
通过排查mem_free变量报错
加上’mem_free’即可