-
mysqluser=`cat $filepath/mysql_monitor.txt|grep instance_name|awk -F'=' '{print $2}'`
-
-
mysql_dir=`cat /etc/passwd |grep $mysqluser |awk -F':' '{print $6}'`
从文本中获取一个用户名,查找用户的根目录,结果发现找不到。
原因:文本从windows 中copy 的,格式为dos,有特殊字符。
解决方法:拷贝到linux 中,需要设置格式
vi 1.txt
:set ff=unix
:set nobomb
:wq
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29071259/viewspace-1377398/
,如需转载,请注明出处,否则将追究法律责任。