+ -
当前位置:首页 → 问答吧 → 请教一个shell问题

请教一个shell问题

时间:2011-07-13

来源:互联网

我的系统是centos
脚本如下
#!/bin/sh
`clear`
执行时报如下错
: command not found
: command not found
但是clear命令是被执行了的,请问为什么会报: command not found呢?

作者: yiyamzen   发布时间: 2011-07-13

本帖最后由 where27 于 2011-07-13 10:02 编辑

因为clear的输出为空,所以执行空的时候会报错command not found
,可以参照下面
  1. [root@ZB-MS-TEST01 test]# a=ls
  2. [root@ZB-MS-TEST01 test]# echo $a
  3. ls
  4. [root@ZB-MS-TEST01 test]# ls
  5. 1    16  23  30  38  45  52  7   77
  6. [root@ZB-MS-TEST01 test]# `echo $a`
  7. 1    16  23  30  38  45  52  7   77
复制代码

作者: where27   发布时间: 2011-07-13

热门下载

更多