VirtualBox

source: kBuild/trunk/src/grep/tests/envvar-check@ 3532

Last change on this file since 3532 was 3529, checked in by bird, 3 years ago

Imported grep 3.7 from grep-3.7.tar.gz (sha256: c22b0cf2d4f6bbe599c902387e8058990e1eee99aef333a203829e5fd3dbb342), applying minimal auto-props.

File size: 1.4 KB
Line 
1# -*- sh -*-
2# Check environment variables for sane values while testing.
3
4# Copyright (C) 2000-2021 Free Software Foundation, Inc.
5
6# This program is free software: you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation, either version 3 of the License, or
9# (at your option) any later version.
10
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15
16# You should have received a copy of the GNU General Public License
17# along with this program. If not, see <https://www.gnu.org/licenses/>.
18
19if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
20 as_unset=unset
21else
22 as_unset=false
23fi
24
25envvar_check_fail=0
26vars='
27 _POSIX2_VERSION
28 _STDBUF_E
29 _STDBUF_I
30 _STDBUF_O
31 BASH_ENV
32 BLOCKSIZE
33 BLOCK_SIZE
34 CDPATH
35 COLUMNS
36 DF_BLOCK_SIZE
37 DU_BLOCK_SIZE
38 ENV
39 LANGUAGE
40 LS_BLOCK_SIZE
41 LS_COLORS
42 OMP_NUM_THREADS
43 POSIXLY_CORRECT
44 QUOTING_STYLE
45 SIMPLE_BACKUP_SUFFIX
46 TABSIZE
47 TERM
48 COLORTERM
49 TIME_STYLE
50 TMPDIR
51 VERSION_CONTROL
52'
53for var in $vars
54do
55 $as_unset $var
56 if eval test \"\${$var+set}\" = set; then
57 echo "$0: the $var environment variable is set --" \
58 ' unset it and rerun this test' >&2
59 envvar_check_fail=1
60 fi
61done
62
63test "$envvar_check_fail" = 1 && exit 1
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette