首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 操作系统 > UNIXLINUX >

请帮小弟我看看这个脚本

2012-02-24 
请帮我看看这个脚本#!/bin/bash#Usingforandlooptoreadtheaccountofthislinuxserver!#Daniel2007/07/21acc

请帮我看看这个脚本
#!/bin/bash
#   Using   for   and   loop   to   read   the   account   of   this   linux   server!
#   Daniel   2007/07/21
    account= 'cut   -d   ": "   -f1   /etc/passwd|sort '
    echo   "The   following   is   your   linux   server 's   account "
    for   i   in   $account
    do
echo   $i
    done

本来是想将linux主机帐号显示出来,但是运行结果却显示的是  
cut
-d
": "
等等,也就是没有执行cut   -d   ": "   -f1   /etc/passwd|sort '
这句话,这是怎么回事?我是照抄书上的实例的啊?应该怎么改呢?
谢谢了

[解决办法]
拷回去试一下,应该是你的符号写错了,不是单引号
account=`cut -d ": " -f1 /etc/passwd|sort`

热点排行