]> git.bundesbrandschatzamt.de Git - emacsconfig.git/commitdiff
org snippets: added srcshtable.
authorAndreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
Mon, 1 Feb 2016 16:50:12 +0000 (17:50 +0100)
committerAndreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
Mon, 1 Feb 2016 16:50:12 +0000 (17:50 +0100)
snippets/org-mode.org
snippets/org-mode/tablesrcsh [new file with mode: 0644]

index 9a6ed6df4d1b1be5e5b591fdc1082e7f5648a2a2..36856f04eed63fcfc00d1c202b6a140a43b10261 100644 (file)
@@ -6,6 +6,8 @@
 | sqlmysql     | sqlmysql    | properties to connect to MySQL via org               |
 | sqlora       | sqlora      | properties to connect to Oracle via org and Perl DBI |
 | <sclient     | srcclient   | SRC snippet executable on a shell session            |
+| <srcsh       | srcsh       | SRC snippet with NAME and lots of parameters         |
+| <srcshtable  | srcshtable  | SRC snippet with org list for HOSTS loop.            |
 | <ssession    | srcsession  | create a shell session and connect to a host via ssh |
 | table2       | table2      | create org table with name and Amount Summary        |
 | title        | title       | skeleton for TITLE                                   |
diff --git a/snippets/org-mode/tablesrcsh b/snippets/org-mode/tablesrcsh
new file mode 100644 (file)
index 0000000..5c6e149
--- /dev/null
@@ -0,0 +1,17 @@
+# -*- mode: snippet -*-
+# name: tablesrcsh
+# 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))))`}
+- $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
+    echo "----------------------------------------"
+    echo \$\{i\}
+
+    echo "----------------------------------------"
+  done
+#+END_SRC