diff --git a/.bashrc.d/cnssh.bash b/.bashrc.d/cnssh.bash index 8293033..6bc3b9c 100644 --- a/.bashrc.d/cnssh.bash +++ b/.bashrc.d/cnssh.bash @@ -108,10 +108,6 @@ cnssh() { # Helper for sshing into Crestron devices ;; esac - for opt in "${!sshopts[@]}"; do - sshoptstring="$sshoptstring -o $opt=${sshopts[$opt]}" - done - # Option Parsing #### @@ -121,7 +117,11 @@ cnssh() { # Helper for sshing into Crestron devices sshpass -p "${cnssh_conf[pass]}" \ "${cnssh_conf[method]}" \ - $sshoptstring \ + $( # Format sshopts as a string that an ssh program understands + for opt in "${!sshopts[@]}"; do + printf '%s %s=%s ' "-o" "$opt" "${sshopts[$opt]}" + done + ) \ "${cnssh_conf[cmd]}" # Main