network/stress/ssh/ssh-stress01-rmt: fix shellcheck error
PATCH 1/1 network/stress/ssh/ssh-stress01-rmt: fix shellcheck error
testcases/network/stress/ssh/ssh-stress01-rmt:57:16: error: Since you double quoted this, it will not word split, and the loop will only run once. [SC2066]
--- testcases/network/stress/ssh/ssh-stress01-rmt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
testcases/network/stress/ssh/ssh-stress01-rmt +1 -1
@@ -54,7 +54,7 @@ done all_conn=$(ps auxw | grep -Fv grep | \ grep "ssh[[:blank:]].*${ssh_config}" | awk '{print $2}') -for ssh_pid in "$all_conn"; do +for ssh_pid in $all_conn; do kill $ssh_pid done
Signature · 1 line
2.14.1
PATCH 1/1 network/stress/ssh/ssh-stress01-rmt: fix shellcheck error
Quoted 4 lines · Yixin Zhang
testcases/network/stress/ssh/ssh-stress01-rmt:57:16: error: Since you double quoted this, it will not word split, and the loop will only run once. [SC2066]
Right. Hopefully 'kill' accepts a list of pids.
Quoted 10 lines
Signed-off-by Yixin Zhang <[email protected]>--- testcases/network/stress/ssh/ssh-stress01-rmt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)testcases/network/stress/ssh/ssh-stress01-rmt +0
-0
testcases/network/stress/ssh/ssh-stress01-rmt done · line 58
Quoted 6 lines
testcases/network/stress/ssh/ssh-stress01-rmt +1
-1@@ -54,7 +54,7 @@ done all_conn=$(ps auxw | grep -Fv grep | \ grep "ssh[[:blank:]].*${ssh_config}" | awk '{print $2}') -for ssh_pid in "$all_conn"; do +for ssh_pid in $all_conn; do kill $ssh_pid
Could we just add 'kill $all_conn', or use the above pattern with pkill, i.e.
pkill -f "ssh .*$ssh_config"
instead of adding $all_conn and the 'for' loop?
Zhang
PATCH 1/1 network/stress/ssh/ssh-stress01-rmt: fix shellcheck error
Hi Alexey,
Thanks for the comment, a V2 patch is sent.
Yixin
Quoted 30 lines · Alexey Kodanev
Quoted 4 lines · Yixin Zhang
testcases/network/stress/ssh/ssh-stress01-rmt:57:16: error: Since you double quoted this, it will not word split, and the loop will only run once. [SC2066]
Right. Hopefully 'kill' accepts a list of pids.
Quoted 10 lines
Signed-off-by Yixin Zhang <[email protected]>--- testcases/network/stress/ssh/ssh-stress01-rmt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)testcases/network/stress/ssh/ssh-stress01-rmt +0
-0testcases/network/stress/ssh/ssh-stress01-rmt done · line 58
Quoted 6 lines
testcases/network/stress/ssh/ssh-stress01-rmt +1
-1@@ -54,7 +54,7 @@ done all_conn=$(ps auxw | grep -Fv grep | \ grep "ssh[[:blank:]].*${ssh_config}" | awk '{print $2}') -for ssh_pid in "$all_conn"; do +for ssh_pid in $all_conn; do kill $ssh_pidCould we just add 'kill $all_conn', or use the above pattern with pkill, i.e.
pkill -f "ssh .*$ssh_config"
instead of adding $all_conn and the 'for' loop?