Skip to content

Commit bbaee2b

Browse files
change -n to -nn because -n is a valid argument for SSH that we sometimes need
1 parent 850eebd commit bbaee2b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

bin/sr3_ssh

+3-2
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,14 @@ if [ -e "${ssh_user_config}" ] && { [ -z "${SSH_AUTH_SOCK}" ] || [ -z "${SSH_AGE
3232
fi
3333

3434
# numerical host, issue #19
35-
if [[ "$1" == "-n"* ]] ; then
35+
if [[ "$1" == "-nn"* ]] ; then
3636
machine_list="${git_tld}/_dsh_config/${pump_name}.list"
3737
if [ ! -e "${machine_list}" ]; then
3838
echo "[ERROR] dsh machine list does not exist (${machine_list})."
3939
exit 4
4040
fi
41-
hostname="$(head "${1}" "${machine_list}" | tail -n1)"
41+
head_n="${1/nn/n}"
42+
hostname="$(head "${head_n}" "${machine_list}" | tail -n1)"
4243
echo "Host ${1} --> ${hostname}"
4344
shift
4445
fi

0 commit comments

Comments
 (0)