#Code
sed使用备注
sed功能介绍
先看下官方的介绍
Sed is a stream editor. A stream editor is used to perform basic text transformations on an input stream (a file or input from a pipeline).
While in some ways similar to an editor which permits scripted edits (such as ed), sed works by making only one pass over the input(s), and
is consequently more efficient. But it is sed’s ability to filter text in a pipeline which particularly distinguishes it from other types of
editors.
大概的意思,是面向流的文本编辑工具。一般用来对文件中的文本进行替换等操作。
以下备注一些常用的操作方式了。
·2min·李岩
sed使用备注c++插件管理--pluma<实践>
最近研究了一下pluma的使用。发现官网上的简单示例对于刚入门的人来说还是麻烦了些(而且还有语法错误)。
下面重新整理了一个例子,作为备注。
·2min·李岩
c++插件管理--pluma<实践>python调试方法(其一)
<一> 这里记录一些python调试的方法:
# coding=UTF-8
''' python debug method 1
use print function to get output informatino
'''
DEBUG = True
def _debug_(*args, **kwds):
''' depends on DEBUG value, print some function '''
global DEBUG
if DEBUG:
print(args, kwds)
if __name__ == "__main__":
_debug_("this is a test")
最常见的调试方法了。print可以依据需求调整为其他的方式(logging输出日志或者直接输出到文件中均可)。
·2min·李岩
python调试方法(其一)shell-访问字符串同名变量
考虑以下场景:
期望通过给定的变量名称var_str,打印出该名称对应的变量值${var_str}。使用指令eval可以很方便的实现:
var_str="1213";
ned_param_name="var_str";
eval echo '$'"${ned_param_name}";
输出结果为1213;
·1min·李岩
shell-访问字符串同名变量lisp-do循环
lisp中,do循环形象如下:
(do (variable-definition*)
(end-test-form result-form*)
statement*);
·1min·李岩
lisp-do循环