免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 9264 | 回复: 5
打印 上一主题 下一主题

[其他] tee >& | ,grep xx file > /dev/null [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2020-08-01 20:04 |只看该作者 |倒序浏览
本帖最后由 xinshou6 于 2020-08-07 13:31 编辑

| tee 跟 2>&1  | tee 结果一样 >& | tee不行  >& 少点
2、grep xx file > /dev/null  这是干啥-----后面有个 if ( ! $status ) then 是看文件有没有xx。这是csh的, bash下是$?。 https://www.cyberciti.biz/faq/li ... exit-statusin-bash/  https://www.grymoire.com/Unix/Csh.html https://www.tutorialspoint.com/unix_commands/csh.htm https://blog.csdn.net/helloxiaozhe/article/details/80940066 https://www.cnblogs.com/zhuandshao/p/7193564.html
----bash下,export aaa=2 ,echo $?aaa是返回值aaa。csh下setenv aaa 2,echo完是返回值。csh下读输入参数foreach a ( $argv ),  @ count ++,set arglist = ( $arglist $a )。------test -z "$xx" ,length of STRING is zero,但是不显示true 或1。if [ -z str1 ] https://www.cnblogs.com/ariclee/p/6137456.html
回复的咋不出现 ,setenv一行给多个变量赋值怎么写




论坛徽章:
33
ChinaUnix元老
日期:2015-02-02 08:55:39CU十四周年纪念徽章
日期:2019-08-20 08:30:3720周年集字徽章-周	
日期:2020-10-28 14:13:3020周年集字徽章-20	
日期:2020-10-28 14:04:3019周年集字徽章-CU
日期:2019-09-08 23:26:2519周年集字徽章-19
日期:2019-08-27 13:31:262016科比退役纪念章
日期:2022-04-24 14:33:24
2 [报告]
发表于 2020-08-03 10:49 |只看该作者
那么,你的问题是?

论坛徽章:
0
3 [报告]
发表于 2020-08-04 13:53 |只看该作者
本帖最后由 小工匠k 于 2020-08-04 14:56 编辑
  1. command 2>&1 | tee # 1
  2. command | tee #2
复制代码

如果没有信息输出到stderr的话,#1和#2的内容理应一样;
  1. command >& | tee
复制代码

这个>&是什么意思,我还真不知道

论坛徽章:
0
4 [报告]
发表于 2020-08-07 09:27 |只看该作者
回复 2# Shell_HAT

请问setenv 一次多个赋值怎么写 类似export aaa=1;bbb=2这种

论坛徽章:
0
5 [报告]
发表于 2020-08-09 12:38 |只看该作者
   Redirecting Standard Output and Standard Error
       This construct allows both the standard output (file descriptor 1) and the standard error output (file descriptor 2) to be redirected to  the
       file whose name is the expansion of word.

       There are two formats for redirecting standard output and standard error:

              &>word
       and
              >&word

       Of the two forms, the first is preferred.  This is semantically equivalent to

              >word 2>&1

论坛徽章:
59
2015七夕节徽章
日期:2015-08-24 11:17:25ChinaUnix专家徽章
日期:2015-07-20 09:19:30每周论坛发贴之星
日期:2015-07-20 09:19:42ChinaUnix元老
日期:2015-07-20 11:04:38荣誉版主
日期:2015-07-20 11:05:19巳蛇
日期:2015-07-20 11:05:26CU十二周年纪念徽章
日期:2015-07-20 11:05:27IT运维版块每日发帖之星
日期:2015-07-20 11:05:34操作系统版块每日发帖之星
日期:2015-07-20 11:05:36程序设计版块每日发帖之星
日期:2015-07-20 11:05:40数据库技术版块每日发帖之星
日期:2015-07-20 11:05:432015年辞旧岁徽章
日期:2015-07-20 11:05:44
6 [报告]
发表于 2020-10-28 21:19 |只看该作者
Linux下多Man一下。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP