Commit | Line | Data |
---|---|---|
959f3c4c JH |
1 | ?RCS: $Id: spitshell.U,v 3.0.1.4 1997/02/28 16:22:12 ram Exp $ |
2 | ?RCS: | |
3 | ?RCS: Copyright (c) 1991-1993, Raphael Manfredi | |
4 | ?RCS: | |
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 3.0. | |
10 | ?RCS: | |
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 | |
14 | ?RCS: | |
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 | |
18 | ?RCS: | |
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 | |
22 | ?RCS: | |
23 | ?RCS: Revision 3.0.1.1 1993/09/13 16:12:58 ram | |
24 | ?RCS: patch10: made #!-failure message more friendly (WAD) | |
25 | ?RCS: | |
26 | ?RCS: Revision 3.0 1993/08/18 12:09:49 ram | |
27 | ?RCS: Baseline for dist 3.0 netwide release. | |
28 | ?RCS: | |
29 | ?MAKE:spitshell shsharp sharpbang: eunicefix sh | |
30 | ?MAKE: -pick add $@ %< | |
31 | ?S:spitshell: | |
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. | |
34 | ?S:. | |
35 | ?S:shsharp: | |
36 | ?S: This variable tells further Configure units whether your sh can | |
37 | ?S: handle # comments. | |
38 | ?S:. | |
39 | ?S:sharpbang: | |
40 | ?S: This variable contains the string #! if this system supports that | |
41 | ?S: construct. | |
42 | ?S:. | |
43 | ?T:xcat | |
44 | : see if sh knows # comments | |
45 | ?X: This is loaded up early, so avoid being chatty. | |
46 | ?X: echo " " | |
47 | ?X: echo "Checking your $sh to see if it knows about # comments..." >&2 | |
48 | if `$sh -c '#' >/dev/null 2>&1`; then | |
49 | ?X: echo "Your $sh handles # comments correctly." | |
50 | shsharp=true | |
51 | spitshell=cat | |
52 | ?X: echo " " | |
53 | ?X: echo "Okay, let's see if #! works on this system..." | |
54 | xcat=/bin/cat | |
55 | test -f $xcat || xcat=/usr/bin/cat | |
56 | echo "#!$xcat" >try | |
57 | $eunicefix try | |
58 | chmod +x try | |
59 | ./try > today | |
60 | if test -s today; then | |
61 | ?X: echo "It does." | |
62 | sharpbang='#!' | |
63 | else | |
64 | echo "#! $xcat" > try | |
65 | $eunicefix try | |
66 | chmod +x try | |
67 | ./try > today | |
68 | if test -s today; then | |
69 | ?X: echo "It does." | |
70 | sharpbang='#! ' | |
71 | else | |
72 | ?X: echo "Okay, let's see if #! works on this system..." | |
73 | ?X: echo "It's just a comment." | |
74 | sharpbang=': use ' | |
75 | fi | |
76 | fi | |
77 | else | |
78 | echo " " | |
79 | echo "Your $sh doesn't grok # comments--I will strip them later on." | |
80 | shsharp=false | |
81 | ?X: The spitshell script will be perused, so leave it out the UU directory | |
82 | cd .. | |
83 | echo "exec grep -v '^[ ]*#'" >spitshell | |
84 | chmod +x spitshell | |
85 | $eunicefix spitshell | |
86 | spitshell=`pwd`/spitshell | |
87 | cd UU | |
88 | echo "I presume that if # doesn't work, #! won't work either!" | |
89 | sharpbang=': use ' | |
90 | fi | |
91 | rm -f try today | |
92 |