/**************************************************************
* Filename: msg_debug.h
* This is a stand of printk or printf for debug.
* When debug Linux kernel,you can call it.
* When debug other gcc program,you can call it,too.
* Made by Wangyf,2006.4.19 for Linux.
***************************************************************/
#ifndef __MSG_DEBUG_H
#define __MSG_DEBUG_H
/**************************************************************
///grep -R oldstring . 搜索当前目录下所有文件的oldstring字符串
///grep -R -l oldstring . 仅输出找到相应字符串的文件名
///grep -R -L oldstring . 仅输出没有找到相应字符串的文件名
///grep -R -o oldstring . 仅输出找到相应字符串的文件名+oldstring
///sed -i ‘s/oldstring/newstring/g’ .
将当前目录的所有文件中的oldstring替换为newstring
///sed -i ‘s/oldstring/newstring/g’ a.txt b.txt c.txt
将当前目录a.txt b.txt c.txt文件中的oldstring替换为newstring
///以下是替换当前目录下指定字符串的脚本,可以保存为SH脚本来执行
if [ -f ./temp.sh ]; then
mv temp.sh temp.sh.zxdfjiasdfjfs.bak
fi
rm -rf temp.sh
grep -R -l newstring . >temp.sh
echo We will replace files:
cat temp.sh
sed -i ‘s/^/sed -i \"s\/newstring\/newstring\/g\" /g’ temp.sh
echo wait…
cat temp.sh
chmod 755 temp.sh
./temp.sh
rm -rf temp.sh
if [ -f ./temp.sh.zxdfjiasdfjfs.bak ]; then
mv temp.sh.zxdfjiasdfjfs.bak temp.sh
fi
**************************************************************/
/**************************************************************
* 使用说明
*使用msg debug的源文件#include本头文件,就可以调用以下消息函数,
* msg("YourMessage");
* kermsg("YourMessage"); drvmsg("YourMessage");
* irqmsg("YourMessage"); appmsg("YourMessage");
* okmsg("YourMessage"); errmsg(&#