Skip to content

Commit d24f64d

Browse files
authored
Merge pull request #122 from derimagia/uppercase-bash-3
Fix issue #121 - incompatability with bash < 4
2 parents 4b1e860 + 895240f commit d24f64d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

git-open

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ function ssh_resolve() {
7070
# Host regex
7171
# HostName resolved.domain.com
7272
read -r -a ssh_array <<<"${ssh_line}"
73-
ssh_optcode="${ssh_array[0]}"
74-
if [[ ${ssh_optcode^^} == HOST ]]; then
73+
ssh_optcode="$(echo "${ssh_array[0]}" | tr '[:upper:]' '[:lower:]')"
74+
if [[ $ssh_optcode == HOST ]]; then
7575
# Host
7676
ssh_found=false
7777
# Iterate through aliases looking for a match
@@ -84,7 +84,7 @@ function ssh_resolve() {
8484
break
8585
fi
8686
done
87-
elif $ssh_found && [[ ${ssh_optcode^^} == HOSTNAME ]]; then
87+
elif $ssh_found && [[ $ssh_optcode == HOSTNAME ]]; then
8888
# HostName, but only if ssh_found is true (the last Host entry matched)
8989
# Replace all instances of %h with the Host alias
9090
echo "${ssh_array[1]//%h/$domain}"

0 commit comments

Comments
 (0)