foobar if -eq then echo ok else echo fail fi if bar then echo ok else

 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
foobar() {
if [ $# -eq 2 ]; then
echo ok
else
echo fail
fi
if [ $1 = bar ]; then
echo ok
else
echo fail
fi
if [ $2 = "baz boo" ]; then
echo ok
else
echo fail
fi
}
foobar_args() {
echo bar
echo \"baz boo\"
}
foobar $(foobar_args)