bash – 在Ubuntu中的`yes`
发布时间:2020-12-15 22:26:40 所属栏目:安全 来源:网络整理
导读:如何在Ubuntu中将hypen或dash字符( – )作为参数包含在yes中? 在FreeBSD中,我可以这样做: $yes "-tcp" | head -n 2-tcp-tcp 但是在Ubuntu中,我收到一个错误: $yes "-tcp" | head -n 2yes: invalid option -- 't'Try `yes --help' for more information.
如何在Ubuntu中将hypen或dash字符( – )作为参数包含在yes中?
在FreeBSD中,我可以这样做: $yes "-tcp" | head -n 2 -tcp -tcp 但是在Ubuntu中,我收到一个错误: $yes "-tcp" | head -n 2 yes: invalid option -- 't' Try `yes --help' for more information. 解决方法
我认为这会奏效:
$yes -- "-tcp" | head -n 2 双破折号告诉yes停止解析选项. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |