Skip to content

Instantly share code, notes, and snippets.

@benwei benwei/
Last active Mar 14, 2019

What would you like to do?
run remote cases by ssh with multiple arguments using shell -
# 2019 Ben Wei <>
# This is a example script for CI tests for blog
# if not defined in environment variable
# you can use the following command to defined it
# export TEST_SSH_HOST="your_ssh_host"
function run_cases()
local case_name="$1"
local args=""
while [ ! "x$1" = "x" ]; do
printf -v __ %q "$1"
args="$args \"$__\""
if [ "x${TEST_SSH_HOST}" = "x" ]; then
ssh ${TEST_SSH_HOST} "cd test-cases; /bin/bash ./ $args"
return $?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.