bash的文件:grep的bash脚本内部失败,但工作在命令行
#!/bin/bash
grep -l -r "products" Products/
给出输出
: No such file or directory
当从终端提示直接运行,grep -l -r "products" Products/
得到所需的输出,这是包含单词的文件列表。
我使用echo $SHELL
检查了shell的确是bash
所以应该没有区别。可能是什么原因? (Products/
目录包含大约3500个文件)。
在Ubuntu 12.04 LTS上运行。
'pwd'对此有何评论? – WeMakeSoftware
尝试使用绝对路径eks:'/ var/Products /' – Jotne