some shell commands
2013-12-29 13:18
447 查看
some useful sed commands:
sed -n 's/.*seinfo=\([a-zA-Z0-9_]\+\).*/\1/p' se_files/seapp_contexts | sort -u
sed -n -e 's/.*seinfo=\([a-zA-Z0-9_]\+\).*/\1/p' -e 's/.*seinfo="\([a-zA-Z0-9_]\+\)".*/\1/p' se_files/mac_permissions_pr.xml | sort -u
sed -n 's/.*domain=knox_untrusted_app \+.*type=\([a-zA-Z0-9_]\+\).*/\1/p' seapp
_contexts
过滤:
grep store_app allow.type | cut -d ':' -f 2 | cut -d ' ' -f 2 | sort -u | grep -v -E 'binder|process|^file|capability' | while read t; do echo "-e \"/ : $t /d\""; done | tr '\n' ' ' | xargs sed "$@" allow.rule >allow.rule.dec
-- some error, need check
远程执行:
cat mac_permissions.xml | ssh linux "xmlindent" | cat - > mac_permissions_pr.xml
远程copy:
tar czf - se_files.new/ | ssh linux "ssh vm-fedora 'tar xzf - -C tmp' "
sed -n 's/.*seinfo=\([a-zA-Z0-9_]\+\).*/\1/p' se_files/seapp_contexts | sort -u
sed -n -e 's/.*seinfo=\([a-zA-Z0-9_]\+\).*/\1/p' -e 's/.*seinfo="\([a-zA-Z0-9_]\+\)".*/\1/p' se_files/mac_permissions_pr.xml | sort -u
sed -n 's/.*domain=knox_untrusted_app \+.*type=\([a-zA-Z0-9_]\+\).*/\1/p' seapp
_contexts
过滤:
grep store_app allow.type | cut -d ':' -f 2 | cut -d ' ' -f 2 | sort -u | grep -v -E 'binder|process|^file|capability' | while read t; do echo "-e \"/ : $t /d\""; done | tr '\n' ' ' | xargs sed "$@" allow.rule >allow.rule.dec
-- some error, need check
远程执行:
cat mac_permissions.xml | ssh linux "xmlindent" | cat - > mac_permissions_pr.xml
远程copy:
tar czf - se_files.new/ | ssh linux "ssh vm-fedora 'tar xzf - -C tmp' "
相关文章推荐
- shell 中变量的定义
- Shell位置参数
- Bash Shell let命令
- shell编程的小例子
- linux shell 脚本攻略学习15--如何只列出目录,如何快速切换目录
- linux shell 脚本攻略学习14--head命令详解,tail命令详解
- [genome shell]标题栏优化
- vxworks Shell下常用的命令
- vxWorks shell命令
- Shell获取文件后缀名
- 在Wiondows下用powershell编译C/C++程序
- Linux新手之路 - bash shell for if...else
- shell if 参数详解
- linux中shell变量$#,$@,$0,$1,$2的含义解释
- 解决Windows Git Bash中文乱码问题
- shell脚本学习参考----预
- shell脚本学习总结-----第一篇
- shell 进制转换
- Shell程序---学生管理系统
- Shell 脚本读取文件中的每行