% cat temp
$$$ hello1
$$ hello2
hello3
## hello4
hello5 $$$
% cat temp | grep "$$$"
Illegal variable name.
% cat temp | grep "\$\$\$"
Variable name must contain alphanumeric characters.
%
我希望到grep爲$$$
,我希望得到的結果是
% cat temp | grep <what should go here?>
$$$ hello1
hello5 $$$
%
爲了區別,我也標誌着提示符%
。
- 這裏有什麼問題?
- grep string應該是什麼?
你的第二個命令是正確的(帶有$ escaped),但是你需要使用單引號,而不是雙引號。 – 2010-09-21 11:48:51