没有该文件或目录 What's Wrong ???

sh/bash/dash/ksh/zsh等Shell脚本
回复
头像
fengjie
帖子: 130
注册时间: 2008-03-19 14:20
来自: 广西柳州
送出感谢: 1 次
接收感谢: 0

没有该文件或目录 What's Wrong ???

#1

帖子 fengjie » 2008-12-14 14:39

代码: 全选

fengjie@fengjie-desktop:~/conky/scripts$ ls -al
总用量 84
drwxr-xr-x 2 fengjie fengjie  4096 2008-12-14 15:30 .
drwxr-xr-x 3 fengjie fengjie  4096 2008-12-11 18:41 ..
-rwxr-xr-x 1 fengjie fengjie  3221 2007-09-23 17:23 amarok
-rwxrwxrwx 1 fengjie fengjie   388 2008-12-14 10:33 check_gmail.sh 
-rwxrwxrwx 1 fengjie fengjie   551 2008-04-19 19:49 conditions.sh
-rwxrwxrwx 1 fengjie fengjie 47618 2008-05-18 17:51 conkyForecast.py
-rw-rw---- 1 fengjie fengjie  3757 2008-05-20 16:40 conkyrc
-rwxrwxrwx 1 fengjie fengjie 10220 2008-06-13 20:32 pogodynka.sh
fengjie@fengjie-desktop:~/conky/scripts$ ./check_gmail.sh
bash: ./check_gmail.sh: 没有该文件或目录
fengjie@fengjie-desktop:~/conky/scripts$ 
到底什么原因啊!??
主板:ASUS P8Z77-V
CPU:Intel 酷睿i3 3200
内存:ADTA DDRⅢ 1600 8G
显卡:Intel® HD Graphic
声卡:Realtek ALC 892
有线网卡:Intel® 82579V
无线网卡:Qualcomm Atheros AR9485
硬盘:WDC WD6401AALS
电源:长城ATX-350SD静音大师
显示器:Samsung S24A350H
aerofox
帖子: 1453
注册时间: 2008-05-24 8:30
送出感谢: 2 次
接收感谢: 31 次

Re: 没有该文件或目录 What's Wrong ???

#2

帖子 aerofox » 2008-12-15 15:06

看看./check_gmail.sh的内容,比如是否用了一个未安装的解释器等。或者试试

代码: 全选

bash -v ./check_gmail.sh
看看有什么错误。
头像
fengjie
帖子: 130
注册时间: 2008-03-19 14:20
来自: 广西柳州
送出感谢: 1 次
接收感谢: 0

Re: 没有该文件或目录 What's Wrong ???

#3

帖子 fengjie » 2008-12-15 19:37

代码: 全选

fengjie@fengjie-desktop:~/conky/scripts$ ls -al
总用量 84
drwxr-xr-x 2 fengjie fengjie  4096 2008-12-14 15:30 .
drwxr-xr-x 3 fengjie fengjie  4096 2008-12-11 18:41 ..
-rwxr-xr-x 1 fengjie fengjie  3221 2007-09-23 17:23 amarok
-rwxrwxrwx 1 fengjie fengjie   388 2008-12-14 10:33 check_gmail.sh 
-rwxrwxrwx 1 fengjie fengjie   551 2008-04-19 19:49 conditions.sh
-rwxrwxrwx 1 fengjie fengjie 47618 2008-05-18 17:51 conkyForecast.py
-rw-rw---- 1 fengjie fengjie  3757 2008-05-20 16:40 conkyrc
-rwxrwxrwx 1 fengjie fengjie 10220 2008-06-13 20:32 pogodynka.sh
fengjie@fengjie-desktop:~/conky/scripts$ bash -v ./check_gmail.sh
bash: ./check_gmail.sh: 没有该文件或目录
fengjie@fengjie-desktop:~/conky/scripts$ 
继续郁闷.............

check_gmail.sh 内容:

代码: 全选

#!/bin/bash
#检测有无新邮件
gmail_login="xxx" 
gmail_password="xxx"

dane="$(wget --secure-protocol=TLSv1 --timeout=3 -t 1 -q -O - https://${gmail_login}:${gmail_password}@mail.google.com/mail/feed/atom --no-check-certificate | grep 'fullcount' | sed -e 's/.*<fullcount>//;s/<\/fullcount>.*//' 2>/dev/null)"
if [ -z "$dane" ]; then
	echo "Error"
else
	echo "$dane"
fi
主板:ASUS P8Z77-V
CPU:Intel 酷睿i3 3200
内存:ADTA DDRⅢ 1600 8G
显卡:Intel® HD Graphic
声卡:Realtek ALC 892
有线网卡:Intel® 82579V
无线网卡:Qualcomm Atheros AR9485
硬盘:WDC WD6401AALS
电源:长城ATX-350SD静音大师
显示器:Samsung S24A350H
aerofox
帖子: 1453
注册时间: 2008-05-24 8:30
送出感谢: 2 次
接收感谢: 31 次

Re: 没有该文件或目录 What's Wrong ???

#4

帖子 aerofox » 2008-12-18 12:49

建议你输入命令时用bash的自动完成功能,输入完check就可以按TAB了。
也许文件名末尾多了一个空格之类的。
回复

回到 “Shell脚本”