1 ?RCS: $Id: spitshell.U 1 2006-08-24 12:32:52Z rmanfredi $
3 ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
5 ?RCS: You may redistribute only under the terms of the Artistic Licence,
6 ?RCS: as specified in the README file that comes with the distribution.
7 ?RCS: You may reuse parts of this distribution only within the terms of
8 ?RCS: that same Artistic Licence; a copy of which may be found at the root
9 ?RCS: of the source tree for dist 4.0.
11 ?RCS: $Log: spitshell.U,v $
12 ?RCS: Revision 3.0.1.4 1997/02/28 16:22:12 ram
13 ?RCS: patch61: removed useless chatter as this is now done very early
15 ?RCS: Revision 3.0.1.3 1995/01/11 15:37:01 ram
16 ?RCS: patch45: use 'test -f' instead of 'test -r' for exec-only cat progs (WED)
17 ?RCS: patch45: protected "sh -c" within backquotes for Linux and SGI
19 ?RCS: Revision 3.0.1.2 1994/08/29 16:33:00 ram
20 ?RCS: patch32: don't create spitshell under the UU directory
21 ?RCS: patch32: allow for cat in /bin or /usr/bin
23 ?RCS: Revision 3.0.1.1 1993/09/13 16:12:58 ram
24 ?RCS: patch10: made #!-failure message more friendly (WAD)
26 ?RCS: Revision 3.0 1993/08/18 12:09:49 ram
27 ?RCS: Baseline for dist 3.0 netwide release.
29 ?MAKE:spitshell shsharp sharpbang: eunicefix sh Head
30 ?MAKE: -pick add $@ %<
32 ?S: This variable contains the command necessary to spit out a runnable
33 ?S: shell on this system. It is either cat or a grep -v for # comments.
36 ?S: This variable tells further Configure units whether your sh can
37 ?S: handle # comments.
40 ?S: This variable contains the string #! if this system supports that
45 ?X: "paths" comes from Head
46 ?LINT:extern paths _exe
47 : see if sh knows # comments
48 ?X: This is loaded up early, so avoid being chatty.
50 ?X: echo "Checking your $sh to see if it knows about # comments..." >&2
51 if `$sh -c '#' >/dev/null 2>&1`; then
52 ?X: echo "Your $sh handles # comments correctly."
56 ?X: echo "Okay, let's see if #! works on this system..."
58 test -f $xcat$_exe || xcat=/usr/bin/cat
59 if test ! -f $xcat$_exe; then
60 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
61 if test -f $p/cat$_exe; then
66 if test ! -f $xcat$_exe; then
67 echo "Can't find cat anywhere!"
74 ./sharp > today 2>/dev/null
75 if test -s today; then
79 echo "#! $xcat" > sharp
82 ./sharp > today 2>/dev/null
83 if test -s today; then
87 ?X: echo "Okay, let's see if #! works on this system..."
88 ?X: echo "It's just a comment."
94 echo "Your $sh doesn't grok # comments--I will strip them later on."
96 ?X: The spitshell script will be perused, so leave it out the UU directory
98 echo "exec grep -v '^[ ]*#'" >spitshell
101 spitshell=`pwd`/spitshell
103 echo "I presume that if # doesn't work, #! won't work either!"