[PATCH lkp-tests] sshd: fix error when execute in docker

error: bash: 1605766611473034209%""+"": syntax error: operand expected (error token is """+""") Signed-off-by: Zhang Yale <ylzhangah@qq.com> --- daemon/sshd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daemon/sshd b/daemon/sshd index 1a1d59b4..a3fdf954 100755 --- a/daemon/sshd +++ b/daemon/sshd @@ -77,7 +77,7 @@ set_port() for i in $(seq 1 10) do - port=$(($(date +%s%N)%"$sshr_port_len"+"$sshr_port_base")) + port=$(($(date +%s%N)%${sshr_port_len}+${sshr_port_base})) ssh -o StrictHostKeyChecking=no -o ExitOnForwardFailure=yes -o TCPKeepAlive=yes \ -Nf -R $port:localhost:22 sshr@"$sshr_ip" -p "$sshr_port" &>/dev/null [ $? -eq 0 ] && return -- 2.23.0

On Thu, Nov 19, 2020 at 05:07:48PM +0800, Wu Fengguang wrote:
- port=$(($(date +%s%N)%"$sshr_port_len"+"$sshr_port_base")) + port=$(($(date +%s%N)%${sshr_port_len}+${sshr_port_base}))
style: white space around the operators.
Ok
${} is not necessary inside $(( ))
Thanks, Fengguang
Ok, I got it. Thanks, Yale
participants (2)
-
Wu Fengguang
-
Zhang Yale