对不起,如果这是一个noobie问题,但我找不到一个好的答案.
要查找然后删除我可以使用的东西
find . -name ".txt" -exec rm "{}" \;
Run Code Online (Sandbox Code Playgroud)
但为什么我不能把结果管道化为rm
find . -name ".txt" | rm
Run Code Online (Sandbox Code Playgroud)
就像我会把它吹到grep一样
find . -name ".txt" | grep a
Run Code Online (Sandbox Code Playgroud)
我从某个地方读过rm不接受来自stdin的输入,因此我无法管道但是这意味着什么?当我输入rm a.txt时,它会从标准输入中读取,就像我可以直接读取一样吗?或者stdin和命令行之间有区别.救命!
我正在学习词汇分析课程,并\t\v\r
在词法分析器定义中用于表示空格.什么是\v
和\r
准确?
我一直在阅读"javascript:好的部分".
Function.prototype.method = function (name, func) {
this.prototype[name] = func;
return this;
};
Run Code Online (Sandbox Code Playgroud)
示例用法是:
Number.method('integer', function () {
return Math[this < 0 ? 'ceiling' : 'floor'](this);
});
document.writeln((-10 / 3).integer()); // -3
Run Code Online (Sandbox Code Playgroud)
两个问题:
"通过使用方法方法扩充Function.prototype ,我们不再需要输入原型属性的名称.现在可以隐藏这一点丑陋." 那是什么意思?所以它节省了输入".prototype.integer"?似乎并不重要.
我们进行了扩充Function.prototype
,这听起来是功能特有的.Number是本机类型,我们应该增加Object.prototype
吗?