chiark / gitweb /
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
@@ -0,0 +1,5 @@
+#!/usr/bin/perl -pi
+next unless m{^#\@ };
+my $ok = 1;
+s{@(\w+)@}{ $ENV{$1} // ($ok=0, $&) }ge;
+s{^#\@ }{} if $ok;