Linux下程序报出/bin/bash: No such file or directory
技术支持服务电话:15308000360 【7x24提供运维服务,解决各类系统/软硬件疑难技术问题】
以如下脚本为例,
#!/bin/bash
conn='mysql -upitt -p123456 -hhostname --default-character-set=UTF8 database'
`$conn -e "select Name from Product1 where Type='Live'" > a.txt`
`$conn -e "select Name from Product2 where Type='Live'" >> a.txt`
echo "query end"
echo "start check"
`cd /home/user/NameCheck`
`grep '@' a.txt | wc -l > result.txt`
使用Notepad++编辑器,
1.Edit菜单栏里选择EOL Conversion侧栏选择UNIX Format
2.Encoding菜单栏里选择Encode in UTF-8 without BOM
这样在Linux下跑不会报出/bin/bash: No such file or directory的错误