Changeset 137 for trunk/tssh
- Timestamp:
- Dec 28, 2017, 4:02:28 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tssh/tssh
r136 r137 112 112 get_host_list () { 113 113 local cluster 114 local default_mode='' 115 116 # set local mode 117 if echo $1 | grep -- ^--mode= 118 then 119 default_mode=$(echo $1 | grep -- ^--mode= | cut -f 2 -d '=') 120 shift 121 fi 122 114 123 for host in $* 115 124 do 116 mode=""117 l ast_char="${host: -1}"125 local mode=${default_mode} 126 local -r last_char="${host: -1}" 118 127 if [ "${last_char}" == "-" -o "${last_char}" == "+" ] 119 128 then … … 123 132 124 133 # short host without login part if any 125 justhost=${host#*@}134 local -r justhost=${host#*@} 126 135 127 136 cluster=$(grep "^${justhost}\b" ${HOME}/.csshrc | cut -f 2 -d '=') … … 155 164 # cluster, jump in a recursive mode 156 165 [ "${verbose}" == 'yes' ] && echo Warning: recursive mode for cluster ${cluster} with mode ${mode} 157 cluster=$(get_host_list "${cluster}${mode}")166 cluster=$(get_host_list --mode=${mode} "${cluster}") 158 167 fi 159 168 done … … 187 196 fi 188 197 189 session=$(shuf -n 1 /usr/share/dict/words | tr -cd "[:alpha:]")198 local -r session=$(shuf -n 1 /usr/share/dict/words | tr -cd "[:alpha:]") 190 199 191 200 IFS=$'\n' host=($(cat "/tmp/${base_path}/${f}"))
Note: See TracChangeset
for help on using the changeset viewer.