]>
Commit | Line | Data |
---|---|---|
b72432fd JA |
1 | tf is a function |
2 | tf () | |
3 | { | |
0628567a JA |
4 | echo this is ${0##*/} > /dev/null; |
5 | echo a | cat - > /dev/null; | |
b72432fd JA |
6 | test -f ${0##*/} && echo ${0##*/} is a regular file; |
7 | test -d ${0##*/} || echo ${0##*/} is not a directory; | |
8 | echo a; | |
9 | echo b; | |
10 | echo c; | |
0628567a | 11 | echo background > /dev/null & ( exit 1 ); |
b72432fd JA |
12 | echo $?; |
13 | { | |
14 | echo a | |
15 | }; | |
16 | i=0; | |
b80f6443 | 17 | while (( i < 3 )); do |
b72432fd JA |
18 | test -r /dev/fd/$i; |
19 | i=$(( i + 1 )); | |
20 | done; | |
0628567a | 21 | [[ -r /dev/fd/0 && -w /dev/fd/1 ]] || echo oops > /dev/null; |
b72432fd JA |
22 | for name in $( echo 1 2 3 ); |
23 | do | |
24 | test -r /dev/fd/$name; | |
25 | done; | |
26 | if [[ -r /dev/fd/0 && -w /dev/fd/1 ]]; then | |
0628567a | 27 | echo ok > /dev/null; |
b72432fd | 28 | else |
b80f6443 | 29 | if (( 7 > 40 )); then |
b72432fd JA |
30 | echo oops; |
31 | else | |
32 | echo done; | |
33 | fi; | |
0628567a | 34 | fi > /dev/null; |
b72432fd JA |
35 | case $PATH in |
36 | *$PWD*) | |
37 | echo \$PWD in \$PATH | |
38 | ;; | |
39 | *) | |
40 | echo \$PWD not in \$PATH | |
41 | ;; | |
0628567a | 42 | esac > /dev/null; |
b72432fd JA |
43 | while false; do |
44 | echo z; | |
0628567a | 45 | done > /dev/null; |
b72432fd JA |
46 | until true; do |
47 | echo z; | |
0628567a | 48 | done > /dev/null; |
b72432fd JA |
49 | echo \&\|'()' \{ echo abcde \; \}; |
50 | eval fu\%nc'()' \{ echo abcde \; \}; | |
51 | type fu\%nc | |
52 | } | |
53 | tf2 is a function | |
54 | tf2 () | |
55 | { | |
56 | ( { | |
0628567a | 57 | time -p echo a | cat - > /dev/null |
28ef6c31 JA |
58 | } ) 2>&1 |
59 | } | |
b72432fd JA |
60 | cprint.tests is a regular file |
61 | cprint.tests is not a directory | |
62 | a | |
63 | b | |
64 | c | |
65 | 1 | |
66 | a | |
67 | &|() { echo abcde ; } | |
68 | fu%nc is a function | |
69 | fu%nc () | |
70 | { | |
71 | echo abcde | |
72 | } |