相关疑难解决方法(0)

grep在bash脚本中失败但在命令行上运行

bash文件:

#!/bin/bash    
grep -l -r "products" Products/
Run Code Online (Sandbox Code Playgroud)

给出输出

: No such file or directory
Run Code Online (Sandbox Code Playgroud)

直接从终端提示符运行时, grep -l -r "products" Products/提供所需的输出,即包含该单词的文件列表.

我检查使用echo $SHELLshell确实是bash这样,应该没有区别.可能是什么原因?(Products/目录包含大约3500个文件).

在Ubuntu 12.04 LTS上运行.

linux bash shell grep

0
推荐指数
1
解决办法
2295
查看次数

标签 统计

bash ×1

grep ×1

linux ×1

shell ×1