File tree Expand file tree Collapse file tree 1 file changed +0
-86
lines changed
Expand file tree Collapse file tree 1 file changed +0
-86
lines changed Original file line number Diff line number Diff line change @@ -26,89 +26,3 @@ echo ${a:+GOOD} ${idontexist:+BAD} ${null:+BAD} ${idontexist:+}
2626echo ${a+GOOD} ${idontexist+BAD} ${null+GOOD} ${null+}
2727echo ${# hello} ${# null} ${# idontexist}
2828
29- nargs () {
30- echo " $# "
31- }
32-
33- set a ' b c' d ' e'
34- echo $*
35- nargs $*
36- echo " $* "
37- nargs " $* "
38- echo $@
39- nargs $@
40- echo " $@ "
41- nargs " $@ "
42- echo " 1 $@ 2"
43- nargs " 1 $@ 2"
44- echo ${null:- " $@ " }
45- nargs ${null:- " $@ " }
46- (
47- IFS=' :'
48- asdf=' a:s:d:f'
49- echo $asdf
50- nargs $asdf
51- )
52-
53- echo " a
54- b"
55- echo ' a
56- b'
57-
58- # Examples from the spec
59- # ${parameter}: dash and busybox choke on this
60- # a=1
61- # set 2
62- # echo ${a}b-$ab-${1}0-${10}-$10
63- # ${parameter-word}
64- foo=asdf
65- echo ${foo-bar} xyz}
66- foo=
67- echo ${foo-bar} xyz}
68- unset foo
69- echo ${foo-bar} xyz}
70- # ${parameter:-word}
71- # unset x
72- # echo ${x:-$(echo >&2 GOOD)} 2>&1
73- # x=x
74- # echo ${x:-$(echo >&2 BAD)} 2>&1
75- # ${parameter:=word}
76- unset X
77- echo ${X:= abc}
78- # ${parameter:?word}
79- # unset posix
80- # echo ${posix:?}
81- # ${parameter:+word}
82- set a b c
83- echo ${3: +posix}
84- # ${#parameter}
85- posix=/usr/posix
86- echo ${# posix}
87- # ${parameter%word}
88- x=file.c
89- echo ${x% .c} .o
90- # ${parameter%%word}
91- x=posix/src/std
92- echo ${x%%/* }
93- # ${parameter#word}
94- x=$HOME /src/cmd
95- echo ${x# $HOME }
96- # ${parameter##word}
97- x=/one/two/three
98- echo ${x##*/ }
99-
100- echo " "
101- echo " Command Substitution"
102- echo $( echo asdf)
103- echo ` echo asdf`
104- echo $(
105- echo a
106- echo b
107- )
108- echo `
109- echo asdf
110- `
111-
112- # Field Splitting
113- # Pathname Expansion
114- # Quote Removal
You can’t perform that action at this time.
0 commit comments