我正在编写一个程序来打印用户名和用户登录的次数,否则打印“未知用户”。
我的代码如下:
iden=$1
c='last | grep -w -c $iden'
if (( $c > 1 ))
then
echo "$iden $c"
else
echo "Unknown user"
fi
Run Code Online (Sandbox Code Playgroud)
我不断收到此错误:
-bash: ((: last | grep -w -c 123: 超出表达式递归级别(错误标记为“c 123”)