-
Notifications
You must be signed in to change notification settings - Fork 1
/
test-builtins.sh
54 lines (54 loc) · 940 Bytes
/
test-builtins.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
## test-builtins
## version 0.0.1 - initial
##################################################
builtins() {
cat << EOF
alias
bind
builtin
caller
command
declare
echo
enable
help
let
local
logout
mapfile
printf
read
readarray
source
type
typeset
ulimit
unalias
EOF
}
generate-disable-builtins-script() {
local builtin
test ! -f "script" || rm -v ${_} 1>/dev/null
for builtin in $( builtins )
do
echo "${builtin}() { true ; }" >> script
done
}
test-builtins() {
generate-disable-builtins-script
}
##################################################
if [ ${#} -eq 0 ]
then
true
else
exit 1 # wrong args
fi
##################################################
test-builtins
##################################################
## generated by create-stub2.sh v0.1.2
## on Wed, 28 Aug 2019 13:45:00 +0900
## see <https://github.com/temptemp3/sh2>
##################################################