for├že enough for mplayer to not rely on broken autodetection
[shellsnippets/shellsnippets.git] / posix / cleanenv
1 #!/bin/sh
2 # $MirOS: src/scripts/cleanenv,v 1.4+notz 2009/03/29 13:04:20 tg Exp $
3 #-
4 # Not complicated enough for copyright.
5
6 p=/bin:/usr/bin:/sbin:/usr/sbin:/usr/X11R6/bin
7
8 if test x"$1" = x"-"; then
9         shift
10         exec /usr/bin/env -i \
11             PATH=$p HOME=/ \
12             "$@"
13 fi
14 exec /usr/bin/env -i \
15     PATH=$p $(locale 2>/dev/null | fgrep LC_CTYPE) \
16     DISPLAY="$DISPLAY" HOME="${HOME:-/}" TERM="${TERM:-vt100}" USER="${USER}" \
17     "$@"