|
[20230825]dc命令复杂学习.txt
--//前几天学习dc使用,我当时最后举了一个累加的例子,里面
--//-e后面那一串什么意思,即使看了man dc文档,我当时也没看懂表示什么意思.尝试看了man文档,简单解析如下:
--//我从文档里面取出相关说明:
[characters]
Makes a string containing characters (contained between balanced [ and ] characters), and pushes it on the stack.For
example, [foo]P prints the characters foo (with no newline).
生成一个包含字符的字符串(包含在平衡的[和]字符之间),并将其推到堆栈上。例如,[foo]P打印字符文件(没有换行符)。
sr
Pop the value off the top of the stack and store it into register r.
推出顶端的堆栈值进入内存寄存器,保存到寄存器r。
z
Pushes the current stack depth: the number of objects on the stack before the execution of the z command.
推动当前堆栈深度:在执行z命令之前,堆栈上的对象数。
>r
Pops two values off the stack and compares them assuming they are numbers, executing the contents of register r as a
macro if the original top-of-stack is greater. Thus, 1 2>a will invoke register a's contents and 2 1>a will not.
从堆栈中弹出两个值,并比较它们,假设它们是数字,执行寄存器r的内容作为一个宏,如果原始的堆栈顶部更大。因此,1 2>a 将调用
注册a的内容,而 2 1>a将不会。
--//主要为了下面 |
|