要回家了有点懒了,问一个关于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...
谢谢!
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 "\\#" .
sed '/^\/\/#/s/\/\// /g' test_sed
replace all the pattern of "//" with " " in those lines which starts with "\\#" .