forked from nat/natalieee.net
add initial content (home, about-{natalie,site}, its-laptop)
This commit is contained in:
11
www/src/scripts/execute-bash
Executable file
11
www/src/scripts/execute-bash
Executable file
@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env hy
|
||||
;; vim: filetype=hy
|
||||
(import sys [argv])
|
||||
(import re [sub])
|
||||
(import os [environ :as hy-env])
|
||||
(import subprocess [check-output])
|
||||
|
||||
(setv env hy-env)
|
||||
(setv (get env "PATH") (+ (get hy-env "PATH") ":./scripts"))
|
||||
|
||||
(print (sub r"\$\[(.*?)\]" (fn [sequence] (. (check-output (.group sequence 1) :shell True :executable "/bin/bash" :env env) (decode) (strip))) (with [fp (open (get argv 1) "r")] (.read fp))))
|
Reference in New Issue
Block a user