登录 | 首页 -> 华新鲜事 -> 技术の宅 | 切换到:传统版 / sForum | 树形列表
要回家了有点懒了,问一个关于sed或者awk的simple问题
<<始页  [1]  末页>> 

要回家了有点懒了,问一个关于sed或者awk的simple问题一年多没用了,全忘了:

i need a command line script to do the following: convert line:

//#define LINUX

to line:

#define LINUX

in a file. Let's say this file is test.cpp, what i want is:

sed -e ?/?/g test.cpp

I forget how to express space and hash in sed liao...

谢谢!
[庸人 (1-16 18:15, Long long ago)] [ 传统版 | sForum ][登录后回复]1楼

use standard'\' to denote special character..something like this for your case.

sed '/^\/\/#/s/\/\// /g' test_sed

replace all the pattern of "//" with " " in those lines which starts with "\\#" .

[Rick (1-18 15:33, Long long ago)] [ 传统版 | sForum ][登录后回复]2楼


<<始页  [1]  末页>> 
登录 | 首页 -> 华新鲜事 -> 技术の宅 | [刷新本页] | 切换到:传统版 / sForum