File: run-with-env.sh

package info (click to toggle)
eglibc 2.13-38%2Bdeb7u6
  • links: PTS, VCS
  • area: main
  • in suites: wheezy-backports
  • size: 148,144 kB
  • sloc: ansic: 916,251; asm: 203,086; sh: 9,197; makefile: 7,792; perl: 2,252; awk: 1,728; cpp: 1,279; pascal: 723; yacc: 317; sed: 131
file content (24 lines) | stat: -rwxr-xr-x 758 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh
# Usage: run-with-env.sh CMD ...
# Execute commands with environment variables set at the last minute.
# For certain environment variable whose names are of the form
# 'EGLIBC_TEST_foo', if they are set, we set an environment variable
# 'foo' to their value.
#
# This lets us run test programs via wrappers with environment
# variable settings that would otherwise interfere with the wrapper
# itself, like LD_PRELOAD or LD_AUDIT.

if [ "${EGLIBC_TEST_LD_PRELOAD+set}" ]; then
    export LD_PRELOAD="${EGLIBC_TEST_LD_PRELOAD}"
fi

if [ "${EGLIBC_TEST_LD_AUDIT+set}" ]; then
    export LD_AUDIT="${EGLIBC_TEST_LD_AUDIT}"
fi

if [ "${EGLIBC_TEST_LD_LIBRARY_PATH+set}" ]; then
    export LD_LIBRARY_PATH="${EGLIBC_TEST_LD_LIBRARY_PATH}"
fi

exec "$@"