Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
att
GitHub Repository: att/ast
Path: blob/master/src/cmd/coshell/init.c
1808 views
1
/***********************************************************************
2
* *
3
* This software is part of the ast package *
4
* Copyright (c) 1990-2011 AT&T Intellectual Property *
5
* and is licensed under the *
6
* Eclipse Public License, Version 1.0 *
7
* by AT&T Intellectual Property *
8
* *
9
* A copy of the License is available at *
10
* http://www.eclipse.org/org/documents/epl-v10.html *
11
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
12
* *
13
* Information and Software Systems Research *
14
* AT&T Research *
15
* Florham Park NJ *
16
* *
17
* Glenn Fowler <[email protected]> *
18
* *
19
***********************************************************************/
20
#pragma prototyped
21
/*
22
* Glenn Fowler
23
* AT&T Research
24
*
25
* remote coshell initialization script
26
*/
27
28
const char corinit[] = "\
29
print -u3 n 0 $HOSTNAME $$\n\
30
set -o bgnice -o monitor\n\
31
rating=1\n\
32
vpath - /# 2>/dev/null\n\
33
eval $COINIT\n\
34
alias ignore='ignore '\n\
35
function ignore\n\
36
{\n\
37
\"$@\"\n\
38
return 0\n\
39
}\n\
40
alias silent='set +x X$- \"$@\";_coshell_flags_=$1;shift;silent '\n\
41
function silent\n\
42
{\n\
43
case $_coshell_flags_ in\n\
44
*x*) trap ' _coshell_status_=$?\n\
45
if ((_coshell_status_==0))\n\
46
then set -x\n\
47
else set -x;(set +x;exit $_coshell_status_)\n\
48
fi' 0\n\
49
;;\n\
50
esac\n\
51
\"$@\"\n\
52
}\n\
53
typeset -xf ignore silent\n\
54
case $rating in\n\
55
1) (\n\
56
set -- $(package host rating cpu)\n\
57
print -u3 r 0 rating=$1,cpu=$2\n\
58
) &\n\
59
;;\n\
60
esac\n\
61
";
62
63