Bash 语法错误:应为操作数(错误标记为“”)
我的当前代码出现以下语法错误:Bash 语法错误:应为操作数(错误标记为“”),bash,unix,Bash,Unix,我的当前代码出现以下语法错误: syntax error: operand expected (error token is " ") 如果我没记错的话,它代表null。为什么会出现这种情况?删除to=symbol后面的空格,并将命令放在$中,以便它进行解析 log= who | grep $1 | cut -c 30-31,33-34 echo $log time= date | cut -c 12-13,15-16 echo $time on=$(($time - $log)) ech
syntax error: operand expected (error token is " ")
如果我没记错的话,它代表null。为什么会出现这种情况?删除to=symbol后面的空格,并将命令放在$中,以便它进行解析
log= who | grep $1 | cut -c 30-31,33-34
echo $log
time= date | cut -c 12-13,15-16
echo $time
on=$(($time - $log))
echo $on
以及
删除to=symbol后面的空格,并将命令放在$内,以便它进行解析
log= who | grep $1 | cut -c 30-31,33-34
echo $log
time= date | cut -c 12-13,15-16
echo $time
on=$(($time - $log))
echo $on
以及
time=$(date | cut -c 12-13,15-16)