日期:2014-05-16  浏览次数:20739 次

请帮我看看这个脚本
#!/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`