# key: <srcshlist
# If you want to reference the output in other src blocks you need a name.
# --
-#+NAME: ${1:`(replace-regexp-in-string "[: ]" "_" (replace-regexp-in-string "[][]" "" (replace-regexp-in-string ".*/" "" (org-display-outline-path nil nil nil t))))`}
+#+NAME: ${1:`(replace-regexp-in-string "[: ]" "_" (replace-regexp-in-string "[][]" "" (replace-regexp-in-string ".*/" "" (org-display-outline-path nil t "/" t))))`}
- $0
-${2:#+NAME: ${3:`(replace-regexp-in-string "[: ]" "_" (replace-regexp-in-string "[][]" "" (replace-regexp-in-string ".*/" "" (org-display-outline-path nil nil nil t))))`-src}}
-#+BEGIN_SRC sh ${4::session ${5:client}} :var HOSTS=$1 :cache ${6:$$(yas-choose-value '("yes" "no"))} :results ${7:$$(yas-choose-value '("verbatim drawer" "table" "list"))}
- for i in \$\{HOSTS\}; do
+${2:#+NAME: ${3:`(replace-regexp-in-string "[: ]" "_" (replace-regexp-in-string "[][]" "" (replace-regexp-in-string ".*/" "" (org-display-outline-path nil t "/" t))))`-src}}
+#+BEGIN_SRC sh ${4::session ${5:client}} :var ${6:HOSTS$(upcase (yas-text))}=$1 :cache ${7:$$(yas-choose-value '("yes" "no"))} :results ${8:$$(yas-choose-value '("verbatim drawer" "table" "list"))}
+ for i in \$\{$6\}; do
echo "----------------------------------------"
echo \$\{i\}
echo "----------------------------------------"
# key: <srcshtable
# If you want to reference the output in other src blocks you need a name.
# --
-#+NAME: ${1:`(replace-regexp-in-string "[: ]" "_" (replace-regexp-in-string "[][]" "" (replace-regexp-in-string ".*/" "" (org-display-outline-path nil nil nil t))))`}
+#+NAME: ${1:`(replace-regexp-in-string "[: ]" "_" (replace-regexp-in-string "[][]" "" (replace-regexp-in-string ".*/" "" (org-display-outline-path nil t "/" t))))`}
| $0 |
-${2:#+NAME: ${3:`(replace-regexp-in-string "[: ]" "_" (replace-regexp-in-string "[][]" "" (replace-regexp-in-string ".*/" "" (org-display-outline-path nil nil nil t))))`-src}}
-#+BEGIN_SRC sh ${4::session ${5:client}} :var HOSTS=$1[,0] :cache ${6:$$(yas-choose-value '("yes" "no"))} :results ${7:$$(yas-choose-value '("verbatim drawer" "table" "list"))}
- for i in \$\{HOSTS\}; do
+${2:#+NAME: ${3:`(replace-regexp-in-string "[: ]" "_" (replace-regexp-in-string "[][]" "" (replace-regexp-in-string ".*/" "" (org-display-outline-path nil t "/" t))))`-src}}
+#+BEGIN_SRC sh ${4::session ${5:client}} :var ${6:HOSTS$(upcase (yas-text))}=$1[,0] :cache ${7:$$(yas-choose-value '("yes" "no"))} :results ${8:$$(yas-choose-value '("verbatim drawer" "table" "list"))}
+$6=($$6)
+
+for INDEX in \`seq 0 1 \$\{#$6[@]\}\`; do
echo "----------------------------------------"
- echo \$\{i\}
+ echo \$\{$6[$\{INDEX\}]\}
echo "----------------------------------------"
- ssh -x \$\{i\}
done
#+END_SRC