Imported Upstream version 1.22.4
[platform/upstream/groff.git] / contrib / groffer / split_env.sh
1 #! /bin/sh
2
3 # groffer - display groff files
4
5 # Source file position: <groff-source>/contrib/groffer/split_env.sh
6 # Installed position: <prefix>/lib/groff/groffer/split_env.sh
7
8 # Copyright (C) 2006-2018 Free Software Foundation, Inc.
9 # Written by Bernd Warken <groff-bernd.warken-72@web.de>.
10
11 # This file is part of 'groffer', which is part of 'groff'.
12
13 # 'groff' is free software; you can redistribute it and/or modify it
14 # under the terms of the GNU General Public License as published by
15 # the Free Software Foundation, either version 3 of the License, or
16 # (at your option) any later version.
17
18 # 'groff' is distributed in the hope that it will be useful, but
19 # WITHOUT ANY WARRANTY; without even the implied warranty of
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
21 # General Public License for more details.
22
23 # You should have received a copy of the GNU General Public License
24 # along with this program.  If not, see
25 # <http://www.gnu.org/licenses/gpl-2.0.html>.
26
27 ########################################################################
28
29 # This file is called from groffer.pl.  The environment variable
30 # of the name in $1 will be split at output.  The corresponding variable
31 # must be exported before the call of groffer.pl.
32
33 if test $# = 0
34 then
35     echo 'split_env.sh was called without an argument.' >&2;
36 else
37     eval v='"$'"$1"'"';
38     if test _"$v"_ != __
39     then
40         eval set x $v;
41         shift;
42         for i in "$@";
43           do
44           echo $i;
45         done;
46     fi;
47 fi;