shell技巧积累

1、find . -name *.cpp | xargs grep -L "-Ddebug"

列出当前目录下所有 不包含 字符串test的.cpp文件名称(有些编译选项需要所有的cpp中都包含, 这条命令就可以找出漏加的文件)

2、遍历目录 for  xx  in  xx

_THREAD_PATH=.
for Thread in `ls $_THREAD_PATH`;do
	echo $Thread
done

3、||操作

resources_check()
{
local RESET_FLAG=`cat /mnt/mtd/config/reset_flag`

if [[ ! -d /mnt/mtd/oem/osd || 1 == $RESET_FLAG ]];then
	mkdir /mnt/mtd/oem/osd
	cp /mnt/mtd/factory/PictureLogo/* /mnt/mtd/oem/osd/ -rf
fi
}

猜你喜欢

转载自blog.csdn.net/weixin_59665492/article/details/120771211
今日推荐