Hi I am trying to make the grep ignore line with certain special characters $(
Input:
/XGenerator.mk:98:LOCAL_MODULE := filesxml.sh
/XGenerator.mk:106:LOCAL_MODULE := doublefiles.sh
/LibParameter.mk:35:LOCAL_MODULE := libparameter$(SUFFIX)
/LibUtility.mk:35:LOCAL_MODULE := libpfw_utility$(SUFFIX)
Expected output:
/XGenerator.mk:98:LOCAL_MODULE := filesxml.sh
/XGenerator.mk:106:LOCAL_MODULE := doublefiles.sh
My try1
grep -Rin "LOCAL_MODULE :=" --include="*.mk" | grep -v '$('
not working
My try2
grep -Rin "LOCAL_MODULE :=" --include="*.mk" | grep -v '/$/('
not working
Please can anyone help ?
You should use a logic OR in your grep command
grep -Rin "LOCAL_MODULE :=" --include="*.mk" | grep -v '\$\|('
Explanation:
The -v flag exclude line matching the pattern, as you already know. The $ character need to be escaped, as well as the OR special character |.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.