grep fails inside bash script but works on command line

后端 未结 1 436
眼角桃花
眼角桃花 2021-01-07 15:45

The bash file:

#!/bin/bash    
grep -l -r \"products\" Products/

gives output

: No such file or directory

1条回答
  •  无人及你
    2021-01-07 16:02

    Your script contains a CR at the end of the grep line. Use dos2unix to remove it.

    0 讨论(0)
提交回复
热议问题