summaryrefslogtreecommitdiff
path: root/app-misc/editor-wrapper/files/editor-wrapper-4.sh
diff options
context:
space:
mode:
Diffstat (limited to 'app-misc/editor-wrapper/files/editor-wrapper-4.sh')
-rw-r--r--app-misc/editor-wrapper/files/editor-wrapper-4.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/app-misc/editor-wrapper/files/editor-wrapper-4.sh b/app-misc/editor-wrapper/files/editor-wrapper-4.sh
new file mode 100644
index 000000000000..b58f1a8b9eeb
--- /dev/null
+++ b/app-misc/editor-wrapper/files/editor-wrapper-4.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+# Copyright 2009-2011 Gentoo Foundation
+# Distributed under the terms of the MIT/X11 license
+
+# Wrapper script, executes ${@VAR@} with arguments $@
+
+if [ -z "${@VAR@}" ]; then
+ # Try to get @VAR@ from system profile
+ @VAR@=$(. /etc/profile >/dev/null 2>&1; echo "${@VAR@}")
+fi
+
+if [ -z "${@VAR@}" ]; then
+ echo "$0: The @VAR@ variable must be set" >&2
+ exit 1
+fi
+
+exec ${@VAR@} "$@"