新手问题:怎么不执行pwd?

sh/bash/dash/ksh/zsh等Shell脚本
回复
eklipseguy
帖子: 61
注册时间: 2007-04-27 22:33

新手问题:怎么不执行pwd?

#1

帖子 eklipseguy » 2007-09-13 12:18

我照着打的第一个Shell脚本,可它怎么不执行pwd, uname -n啊?直接当成字符打出来了。需要作什么配置吗?谢谢。

代码: 全选

#!/bin/bash
#This is the first Bash Shell program of the day
#Scriptname:greetings

echo "Hello, $LOGNAME, it's nice talking to you."
echo "Your present working directory is 'pwd'."
echo "You are working on a machine called 'uname -n'."
echo "Here is a list of your files:"
ls
echo "Bye for now $LOGNAME. The time is 'date +%T'!"
输出是这样的:

代码: 全选

Hello, newguy. it's nice talking to you.
Your present working directory is 'pwd'.
You are working on a machine called 'uname -n'.
Here is a list of your files:
greeting.sh  greeting.sh~
Bye for now newguy The time is 'date +%T'!

头像
windwiny
帖子: 2254
注册时间: 2007-03-13 17:26

#2

帖子 windwiny » 2007-09-13 12:19

单引号 '
反引号 `
头像
bones7456
帖子: 8495
注册时间: 2006-04-12 20:05
来自: 杭州
联系:

#3

帖子 bones7456 » 2007-09-13 12:20

反引号 `就是1的左边那个键。。。
关注我的blog: ε==3
头像
magicsky
帖子: 225
注册时间: 2007-03-30 9:46

#4

帖子 magicsky » 2007-09-13 12:56

``
在国外,众多程序员为了理想而夜以继日;
而在国内,程序员在为填饱自己和家人的肚子而埋头苦干。
eklipseguy
帖子: 61
注册时间: 2007-04-27 22:33

#5

帖子 eklipseguy » 2007-09-13 13:03

收到,谢谢你们! :)
回复