summaryrefslogtreecommitdiff
path: root/app-misc/editor-wrapper/files/editor-wrapper-4.sh
blob: 9c8fe95995523d68e8aec896654924c8ccfbfa34 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh
# Copyright 2009-2011 Gentoo Authors
# 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@} "$@"