summaryrefslogtreecommitdiff
path: root/expect/fixline1
diff options
context:
space:
mode:
Diffstat (limited to 'expect/fixline1')
-rwxr-xr-xexpect/fixline113
1 files changed, 13 insertions, 0 deletions
diff --git a/expect/fixline1 b/expect/fixline1
new file mode 100755
index 00000000000..7ea503fa96a
--- /dev/null
+++ b/expect/fixline1
@@ -0,0 +1,13 @@
+#!expect --
+# Synopsis: fixline1 newpath < input > output
+# Author: Don Libes
+
+# Description: change first line of script to reflect new binary
+# try to match any of the following first lines
+#!expect ...
+#!../expect ...
+#!expectk ...
+#!foo/bar/expectk ...
+#
+regsub "^#!(.*/)*(.*)" [gets stdin] "#!$argv/\\2" line1
+puts -nonewline "$line1\n[read stdin]"