当前时区为 UTC + 8 小时



发表新帖 回复这个主题  [ 3 篇帖子 ] 
作者 内容
1 楼 
 文章标题 : xargs为何换行了
帖子发表于 : 2016-12-24 20:45 

注册: 2016-07-08 17:43
帖子: 87
系统: debian8
送出感谢: 12
接收感谢: 0 次
-0
: 当输入有特殊字符时,将其当作一般字符处理.
test@hwy:~$ echo "//" | xargs -0
//

test@hwy:~$

为何出现换行?


页首
 用户资料  
 
2 楼 
 文章标题 : Re: xargs为何换行了
帖子发表于 : 2016-12-24 21:11 

注册: 2013-05-26 6:58
帖子: 2158
系统: Debian 9
送出感谢: 894
接收感谢: 30
man xargs
引用:
-0 Input items are terminated by a null character instead of by whitespace, and the quotes and backslash are not special (every character is taken literally).
Disables the end of file string, which is treated like any other argument. Useful when input items might contain white space, quote marks, or backslashes. The
GNU find -print0 option produces input suitable for this mode.


"特殊字符"应该指的是特殊的普通字符,像转义字符,双引号之类


_________________
Linux桌面优化综合贴[2017.09.18](欢迎各位补充或指正误区)
[2016.03.10]会C语言但看不懂英文文档的点这里,一个用C语言编写的简陋学习工具
单硬盘通过iso文件实机安装Debian的方法
重启或操作fcitx时失去响应的一个解决方法,不妨试试看


页首
 用户资料  
 
3 楼 
 文章标题 : Re: xargs为何换行了
帖子发表于 : 2016-12-24 22:23 
头像

注册: 2009-04-11 23:46
帖子: 4130
系统: Arch Linux
送出感谢: 11
接收感谢: 124
引用:
and executes the command (default is /bin/echo)


第一个换行来自于你的 echo 调用(你可以用 echo -n 这样就没了),第二个来自于 xargs 调用的 echo。


_________________
我的博客 https://blog.lilydjwg.me/
提问的智慧
Arch Linux 中文论坛

我的vimrc: https://git.io/vimrc


页首
 用户资料  
 
显示帖子 :  排序  
发表新帖 回复这个主题  [ 3 篇帖子 ] 

当前时区为 UTC + 8 小时


在线用户

正在浏览此版面的用户:没有注册用户 和 2 位游客


不能 在这个版面发表主题
不能 在这个版面回复主题
不能 在这个版面编辑帖子
不能 在这个版面删除帖子
不能 在这个版面提交附件

前往 :  
本站点为公益性站点,用于推广开源自由软件,由 DiaHosting VPSBudgetVM VPS 提供服务。
我们认为:软件应可免费取得,软件工具在各种语言环境下皆可使用,且不会有任何功能上的差异;
人们应有定制和修改软件的自由,且方式不受限制,只要他们自认为合适。

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
简体中文语系由 王笑宇 翻译