Commit | Line | Data |
---|---|---|
d8875586 MBT |
1 | ?RCS: $Id: n.U 1 2006-08-24 12:32:52Z rmanfredi $ |
2 | ?RCS: | |
3 | ?RCS: Copyright (c) 1991-1997, 2004-2006, 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 4.0. | |
10 | ?RCS: | |
11 | ?RCS: $Log: n.U,v $ | |
12 | ?RCS: Revision 3.0 1993/08/18 12:09:19 ram | |
13 | ?RCS: Baseline for dist 3.0 netwide release. | |
14 | ?RCS: | |
15 | ?MAKE:n c: contains | |
16 | ?MAKE: -pick add $@ %< | |
17 | ?S:n: | |
18 | ?S: This variable contains the -n flag if that is what causes the echo | |
19 | ?S: command to suppress newline. Otherwise it is null. Correct usage is | |
20 | ?S: $echo $n "prompt for a question: $c". | |
21 | ?S:. | |
22 | ?S:c: | |
23 | ?S: This variable contains the \c string if that is what causes the echo | |
24 | ?S: command to suppress newline. Otherwise it is null. Correct usage is | |
25 | ?S: $echo $n "prompt for a question: $c". | |
26 | ?S:. | |
27 | : first determine how to suppress newline on echo command | |
28 | echo " " | |
29 | echo "Checking echo to see how to suppress newlines..." | |
30 | (echo "hi there\c" ; echo " ") >.echotmp | |
31 | if $contains c .echotmp >/dev/null 2>&1 ; then | |
32 | echo "...using -n." | |
33 | n='-n' | |
34 | c='' | |
35 | else | |
36 | cat <<'EOM' | |
37 | ...using \c | |
38 | EOM | |
39 | n='' | |
40 | c='\c' | |
41 | fi | |
42 | echo $n "The star should be here-->$c" | |
43 | echo '*' | |
44 | rm -f .echotmp | |
45 |