shell_sed技巧
2013-12-09 09:04
162 查看
查找文件夹下特定文件并且打包,当文件名有空格,问题有意思了:
touch "a b c .txt"
find ./ -name "*.txt" | sed 's/\ /\\\ /g' | xargs tar -cvf haha.tar
通过类似system调用,进一步更改
system("find ./ -name "*.txt" | sed 's/\\ /\\\\\\ /g' | xargs tar -cvf haha.tar");
touch "a b c .txt"
find ./ -name "*.txt" | sed 's/\ /\\\ /g' | xargs tar -cvf haha.tar
通过类似system调用,进一步更改
system("find ./ -name "*.txt" | sed 's/\\ /\\\\\\ /g' | xargs tar -cvf haha.tar");
相关文章推荐
- Linux基础入门及系统管理01-shell三剑客之sed命令技巧讲解20
- 俺自己写的一个ftp shell,用了很多技巧哦awk,sed等等
- bash shell sed技巧
- shell删除文本技巧 —— grep, cut, head, sed, awk
- shell技巧(sed 断句、读取指定行)
- Shell 学习6(sed命令)
- shell 文件内容替换 sed用法
- Linux系统下Shell命令行快捷键实用技巧
- Linux中的sed常用技巧
- Shell中求字符串索引的几种技巧
- Shell中字符串反转的几种技巧
- shell学习第十天----sed查找与替换
- 一个shell的应用(sed加awk加正则)
- Linux 中高效编写 Shell 脚本的 10 个技巧
- shell命令一些技巧
- 【shell】sed学习小结1
- shell脚本 - sed文件读取指定行
- shell之awk及sed学习
- shell 命令的一些技巧(不断更新)
- [总结] 常用Shell指令与技巧 [2012-02-08更新]