LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 741|回复: 2

学习shell中遇到一个问题。郁闷中。。。。。。

[复制链接]
发表于 2010-6-3 17:00:03 | 显示全部楼层 |阅读模式
shell内容:
#!/bin/bash
#using the backtick character
testing='date'
echo "the date and time are: " $testing

应该实现的输出是:
the date and time are : Thu Jun  3 00:59:13 GMT+8 2010

但我的输出却是:
the date and time are:  date

不知是哪里错了。
 楼主| 发表于 2010-6-3 17:16:59 | 显示全部楼层
知道为什么了符号错了。应该是用·· 不是用‘’
回复 支持 反对

使用道具 举报

发表于 2010-6-3 19:52:07 | 显示全部楼层
not
testing='date'
but
testing=`date`
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表