Skip to content

Instantly share code, notes, and snippets.

@lgyjg
Created June 12, 2016 03:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lgyjg/347fb669e545259d18ad97a5aee8bdec to your computer and use it in GitHub Desktop.
Save lgyjg/347fb669e545259d18ad97a5aee8bdec to your computer and use it in GitHub Desktop.
批量替换文件中的字符串的shell脚本命令
#restore_cancel 代表需要过滤的字符串关键字
# <string name="restore_cancel">@android:string\/cancel<\/string>/g 代表含有该关键字字符串的行该替换成什么样.
# res 代表查找路径
sed -i 's/^.*restore_cancel.*$/ <string name="restore_cancel">@android:string\/cancel<\/string>/g' `grep restore_cancel -rl res`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment