chiark
/
gitweb
/
~ian
/
hippotat.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Fix up sys.path in scripts
[hippotat.git]
/
subst-sys-path
diff --git a/subst-sys-path
b/subst-sys-path
new file mode 100755
(executable)
index 0000000..
c735104
--- /dev/null
+++ b/
subst-sys-path
@@ -0,0
+1,5
@@
+#!/usr/bin/perl -pi
+next unless m{^#\@ };
+my $ok = 1;
+s{@(\w+)@}{ $ENV{$1} // ($ok=0, $&) }ge;
+s{^#\@ }{} if $ok;