【发布时间】:2019-06-18 07:05:49
【问题描述】:
以下代码语法有效:
echo "pattern_list" | grep -f - "/path/to/file"
还有
grep -f "/path/to/pattern/file" <<< $variable_that_holds_file_content
但是 grep -f 是否可能仅适用于变量?
因为
echo "pattern_list" | grep -f - <<< $variable_that_holds_file_content
不工作。
你能告诉我怎么做吗?谢了!
【问题讨论】: